FloatFormat Function | |
Set the display format for a floating point numeric.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax FUNCTION FloatFormat(
fValue AS FLOAT,
iLen AS LONG,
iDec AS LONG
) AS FLOAT
public static Float FloatFormat(
Float fValue,
int iLen,
int iDec
)
Request Example
View SourceParameters
- fValue
- Type: Float
Any numeric value. - iLen
- Type: Long
The desired length of the display of fValue, including decimal digits, decimal point, and sign.
A value of -1 means that only significant digits to the left of the decimal point will be displayed (any left padding will be suppressed).
- iDec
- Type: Long
The desired number of decimal digits in the display of fValue.
A value of -1 means that only significant digits to the right of the decimal point will be displayed (any right padding will be suppressed).
Return Value
Type:
FloatRemarks
FloatFormat() is used to format floating point numbers. Note that FloatFormat() affects only the display format of numbers and not the actual numeric precision of calculations.
Examples
These examples use FloatFormat() to display the same number using three different formats. Note the number of leading spaces in each result:
1? FloatFormat(1234.546, 12,2)
2? FloatFormat(1234.546, -1,4)
3? Floatformat(1234.546, 12,-1)
See Also