Name
format-number() Function — Takes a number and formats it as a string.
Synopsis
stringformat-number(numberstringstring?)
Inputs
The number to be formatted and the format pattern string are required. The third argument is the optional name of a decimal format; if the third argument is not supplied, the default decimal format is used.
Output
The number, formatted according to the rules supplied by the other arguments. The special characters used in the second argument are:
-
# Represents a digit. Trailing or leading zeroes are not displayed. Formatting the number
4.0with the string “#.##” returns the string “4”.-
0 Represents a digit. Unlike the
#character, the0always displays a zero. Formatting the number4.1with the string “#.00” returns the string “4.10”.-
. Represents the decimal point.
-
- Represents the minus sign.
-
, Is the grouping separator.
-
; Separates the positive-number pattern from the negative-number pattern.
-
% Indicates that a number should be displayed as a percentage. The value will be multiplied by 100, then displayed as a percentage. Formatting the number
.76with the string “##%” returns the string “76%”.-
\u2030 Is the Unicode character for the per-thousand (per-mille) sign. The value will be multiplied by 1000, then displayed as a per mille. Formatting the number
.768with the string “###\u2030” returns the string “768‰”.
The third argument, if given, must be the name of an <xsl:decimal-format> element. The <xsl:decimal-format> element lets you define the ...