Click or drag to resize

StrFloat Function

Convert a float expression to a PSZ.

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

Parameters

flSource
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 <dwLength> is not long enough to hold the entire number,  the result will be in scientific notation.
dwDecimals
Type: UInt32
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#
LOCAL fNumber AS FLOAT
fNumber := 123.45
? StrFloat(fNumber * 10, 7, 2)                        // 1234.50
? StrFloat(fNumber * 10, 12, 4)                // 1234.5000
? StrFloat(fNumber, 10, 1)                        // 1234.5
See Also