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.19
Syntax FUNCTION Str2(
fNumber AS FLOAT,
dwLength AS DWORD
) AS STRING
public static string Str2(
Float fNumber,
uint dwLength
)
Request Example
View SourceParameters
- 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:
StringReturn Value
Type:
StringA 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:
1LOCAL fNumber AS FLOAT
2fNumber := 123.45
3? Str2(fNumber, 4)
4? Str2(fNumber, 2)
See Also