StrZero Function (Usual, Long) | |
Convert a numeric expression to a string and pad it with leading zeroes instead of blanks.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax FUNCTION StrZero(
nNumber AS USUAL,
nLength AS LONG
) AS STRING
public static string StrZero(
Usual nNumber,
int nLength
)
Request Example
View SourceParameters
- nNumber
- Type: Usual
The numeric expression to convert to a string. - nLength
- Type: Long
The length of the string to return, including zeroes, decimal digits, decimal point, and sign.
Return Value
Type:
String
A string.
Remarks
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 a zero ("0") instead of a blank.
For more information, see the Str() function.
Examples
This example uses StrZero() to convert a 3-digit number to a 5-character string:
See Also