Click or drag to resize

StrFloat Function

X#
Convert a float expression to a PSZ.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax
 FUNCTION StrFloat(
	flSource AS FLOAT,
	dwLength AS DWORD,
	dwDecimals AS DWORD
) AS STRING
Request Example View Source

Parameters

flSource
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 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
StrFloat() 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 StrFloat(), depending on the arguments specified:
X#
1LOCAL fNumber AS FLOAT
2fNumber := 123.45
3? StrFloat(fNumber * 10, 7, 2)            // 1234.50
4? StrFloat(fNumber * 10, 12, 4)        // 1234.5000
5? StrFloat(fNumber, 10, 1)            // 1234.5
See Also