The $FNUMBER function returns a string containing a formatted number.
The format for the $FNUMBER function is:
$FN[UMBER](numexpr,expr[,intexpr])
The numeric expression specifies the number that $FNUMBER() formats.
The expression (second argument) specifies zero or more single character format control codes; if the expression contains any character other than the defined codes, $FNUMBER() generates a run-time error.
The optional integer expression (third argument) specifies the number of digits after the decimal point. If the numeric expression has more digits than specified by this argument, $FNUMBER() rounds to obtain the result. If the numeric expression has fewer digits than specified by this argument, $FNUMBER() zero-fills to obtain the result.
When the optional third argument is specified and the first argument evaluates to a fraction between -1 and 1, $FNUMBER() returns a number with a leading zero (0) before the decimal point (.).
$FNUMBER() formats or edits numbers, usually for reporting. For more information on rounding performed by $FNUMBER(), refer to the section on $JUSTIFY().
The formatting codes are:
+: Forces a "+" on positive values.
-: Suppresses the "-" on negative values.
,: Inserts commas every third position to the left of the decimal within the number.
T: Represents the number with a trailing, rather than a leading sign; positive numbers have a trailing space unless the expression includes a plus sign (+).
P: Represents negative values in parentheses, positive values with a space on either side; combining with any other code except comma (,) causes a run-time error.
M: accepts both lower-case and upper-case alphabetic codes. The order of the codes does not affect the result.