Formatting numbers

Formatting of numbers affects the output of the xsl:number instruction, and the fn:format-integer() function.

In xsl:number and in fn:format-integer() it is possible to request a specific language using the lang attribute/argument. The default for this may be set using the Saxon configuration property DEFAULT_LANGUAGE; failing this, the default is taken from the operating system settings. This option mainly affects formatting of numbers as words (for example, in English, "one", "two", "three", or "first", "second", "third") as requested using the format token "W", "w", or "Ww". This is referred to as spellout numbering.

As well as spellout numbering, the choice of language also affects ordinal numbering, for example 10 is output as "10th" in English, "10." in German, "10e" in French, and "10º" in Italian.

For more details on numbering using ICU, see Numbers and dates from ICU.

For more details on writing a plug-in for localizing numbers and dates, see Localizing numbers and dates.