Click or drag to resize

Str2 Function

X#
Convert a numeric expression to a string of a specified length.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax
 FUNCTION Str2(
	fNumber AS FLOAT,
	dwLength AS DWORD
) AS STRING
Request Example View Source

Parameters

fNumber
Type: Float
The numeric expression to convert.
dwLength
Type: DWord
The length of the string to return, including decimal digits, decimal point, and sign.
If siLength is not long enough to hold the entire number, the result will be in scientific notation.

Return Value

Type: String

Return Value

Type: String
A string representation of the value.
Remarks
Str2() is a typed version of the Str() numeric function where both arguments are mandatory. See Str() for a detailed description.
Examples
These examples show how to use Str2() to change a number to a string:
X#
1LOCAL fNumber AS FLOAT
2fNumber := 123.45
3? Str2(fNumber, 4)        // 123.
4? Str2(fNumber, 2)        // **
See Also