This function takes two required arguments and a third optional argument:
format-number(n,p[,f])
where:
| is the number to be formatted |
| is a format pattern string using the characters described below |
| if supplied, this is the name of a named
|
Here are the characters used in the formatting pattern
:p
Table 1. Format pattern characters for format-number()
# | Denotes a digit. Leading and trailing zeroes (and a trailing decimal, if any) will disappear. |
0 | Denotes a digit, but a digit always appears, even if it is a zero. |
- | Shows the position of the minus sign. |
. | Shows the position of the decimal point. |
, | Positions the grouping separator for thousands. For
example, "##,###.00". |
% | Multiplies the number by one hundred and displays it as a percentage. |
; | You can supply two patterns separated by a semicolon; the first one will be used for positive numbers and the second for negative numbers. |
| other | Literal characters are carried through to the result. |