Read XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition Online
Authors: Michael Kay
The first subpicture is used for formatting positive numbers. The second (optional) subpicture is used for negative numbers. If only one subpicture is specified, then the subpicture used for negative numbers is the same as the positive subpicture, but with a minus sign added before the prefix. The actual character used for the minus sign depends on the
The prefix and suffix are just literal characters that are output at the start and end of the number. The only real reason to use them, other than simple convenience, is when they are different for positive and negative numbers. For example, you can use this mechanism to implement the accounting convention of displaying negative numbers in parentheses.
If the prefix or suffix includes a
%
sign, the percent sign will be displayed in the place where it appears in the prefix or suffix, and the number will be multiplied by 100. Similarly, you can also use a per-mille sign
%
in which case the number will be multipled by 1000.
If the number is one of the special values positive or negative infinity or NaN, then it is displayed using the representation defined in the
The special characters used are as follows.
Special Character | Default Value | Meaning |
zero-digit | 0 | A digit will always appear at this point in the result string |
digit | # | A digit will appear at this point in the result string unless it is a redundant leading or trailing zero |
decimal-point | . | Separates the integer and the fraction part of the number |
grouping-separator | , | Separates groups of digits |
pattern-separator | ; | Separates the positive and negative subpictures |
minus-sign | - | Minus sign |
percent-sign | % | Multiplies the number by 100 and shows it as a percentage |