Read XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition Online
Authors: Michael Kay
zero-digit optional | Character | Character used in a format pattern to indicate a place where a leading or trailing zero digit is required, even if it is not significant. Default value is 0 (x30). This character must be one that is classified in the Unicode database as a digit character, with the numeric value zero. |
digit optional | Character | Character used in a format pattern to indicate a place where a digit will appear, provided it is a significant digit. Default value is # (x23). |
pattern-separator optional | Character | Character used in a format pattern to separate the subpattern for positive numbers from the subpattern for negative numbers. Default value is ; (x3B). |
Content
None; the element is always empty.
Effect
If a
name
attribute is supplied, the
format-number()
function when it is called with three arguments (the third argument is the name of a decimal format); the default decimal format is used when the
format-number()
function is called without a third argument.
It is possible to have more than one
zero-digit
) is taken from the declaration with the highest import precedence that specifies a value for the required attribute. It is an error if this selects more than one declaration, unless the values specified are the same.
The
picture string
used as an argument to the
format-number()
function, some of them occur in the final output number itself, and some are used in both. The actual display format of a number depends both on the picture string and on the choice of decimal format symbols.
For example, if there is an
decimal-separator=“,”
grouping-separator=“.” />
then the function call:
format-number(1234.5, ‘#.##0,00’, ‘european’)
will produce the output:
1.234,50
The use of the
.
and
,
characters in both the picture string and the output display is determined by the named
The structure of a picture string is defined in the description of the
format-number()
function in Chapter 13, page 788. The syntax of the picture string uses a number of special symbols: the actual characters used for these symbols are defined in the relevant
decimal-separator
grouping-separator
percent
per-mille
zero-digit
digit
pattern-separator
The
decimal-separator
grouping-separator
infinity
minus-sign
NaN
percent
per-mille
zero-digit
For example, if the
***
, then the output of
format-number(1e0 div 0, $format)
will be
***
, regardless of the picture string.