Click or drag to resize

StrLong Function

X#
Convert a long integer expression to a PSZ.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax
 FUNCTION StrLong(
	liNumber AS LONG,
	dwLength AS DWORD,
	dwDecimals AS DWORD
) AS STRING
Request Example View Source

Parameters

liNumber
Type: Long
The long integer expression to convert.
dwLength
Type: DWord
The length of the string to return, including decimal digits, decimal point, and sign.
If dwLength is not long enough to hold the entire number,
The result will be in scientific notation.
dwDecimals
Type: DWord
The number of decimal places to return.

Return Value

Type: String
Remarks
StrLong() is a typed version of the Str() numeric function, except that SetDecimalSep() is ignored. See Str() for a detailed description.
Examples
These examples demonstrate the range of values returned by StrLong(), depending on the arguments specified:
X#
1LOCAL liNumber AS LONGINT
2liNumber := 12345L
3? StrLong(liNumber, 5, 0)            // "12345"
4? StrLong(liNumber, 4, 0)            //  "****"
5? StrLong(liNumber, 2, 10)        // "**"
6? StrLong(liNumber * 10, 7, 2)        // "****.**"
7? StrLong(liNumber * 10, 12, 4)    // " 123450.0000"
8? StrLong(liNumber, 10, 1)        // " 12345.0"
See Also