Advantage Concepts
Advantage Expression Engine function that converts a numeric expression to a string and pads it with leading zeroes instead of blanks
StrZero(<nNumber>,[<nLength>],[<nDecimals>]) à cString
<nNumber> |
The numeric expression to convert to a string. |
<nLength> |
The length of the string to return, including zeroes, decimal digits, decimal point, and sign. |
<nDecimals> |
The number of decimal places in the return value. |
A string.
STRZERO() is useful in displaying numbers, creating codes such as part numbers from numeric values, and creating order keys that combine numeric and character data. STRZERO() is similar to the STR() function except that the padding character is zero instead of a blank. For more information, see the STR() function.
Note Advantage Expression Engine functions can be used in expressions such as record filter expressions and index expressions. They are not necessarily scalars supported within SQL statements. For a list of supported SQL scalar functions, see Supported Scalar Functions.
This example uses StrZero() to convert a 3-digit number to a 5-character string:
? StrZero(987, 5, 0) // "00987"