Click or drag to resize

Str2 Function

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

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

Parameters

fNumber
Type: Float
The numeric expression to convert.
dwLength
Type: UInt32
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#
LOCAL fNumber AS FLOAT
fNumber := 123.45
? Str2(fNumber, 4)                // 123.
? Str2(fNumber, 2)                // **
See Also