xsl:decimal-format

<xsl:decimal-format>
Syntax:
<xsl:decimal-format

  decimal-separator="character"

  digit="character"



  grouping-separator="character"



  infinity="string"



  minus-sign="character"



  name="qname"



  NaN="string"



  pattern-separator="character"



  percent="character"



  per-mille="character"



  zero-digit="character"



/> 

The xsl:decimal-format element defines the symbols and characters used by the format-number function to convert numbers to strings. This element can be used more than once, but with certain limitations.
Each element can have an optional name value assigned to it by using by the name attribute. However, you cannot repeat name values. Further, you can only omit the name attribute once.
This element does not effect the behavior of the xsl:number and the xsl:value-of elements when they are used to format a number for display in the output. Nor does it effect the string function which has a default procedure for converting numbers to strings.
The xsl:decimal-format element can only be a child of the xsl:stylesheet or the xsl:transform elements.
This is a self-closing element and it cannot contain any child elements or any content.
decimal-separator=”character”
The optional decimal-separator attribute defines what character is used to separate the integer and fraction part of a number. The default is a dot (.).

digit=”character”

The optional digit attribute defines what character is used to signify that a digit is needed in a format pattern. The default is the hash mark (#).

grouping-separator=”character”

The optional grouping-separator attribute defines what character is used to separate groups of digits (for example: 1,763,920). The default is a comma (,).

infinity=”string”
The optional infinity attribute defines what string is used to represent that the value is infinite. The default is the string, “infinity”.

minus-sign=”character”

The optional minus-sign attribute defines what character is used to represent a minus sign. The default is the hyphen (-).

name=”qname”

The optional name attribute assigns a qname to the element. If the name attribute is omitted, then you are declaring that this is the default xsl:decimal-format element. You cannot repeat names. Note that this name can be used as the optional third argument to the format-number function.

NaN=”string”

The optional NaN attribute defines what string is used to indicate that the value is not a number. The default is the string, “NaN”.

pattern-separator=”character”
The optional pattern-separator attribute defines what character is used to separate positive and negative sub-patterns in a format pattern. The default is the semicolon (;).

percent=”character”

The optional percent attribute defines what character is used to represent a percent sign. The default is the percent sign (%).

per-mille=”character”

The optional per-mille attribute defines what character is used to represent the per thousand sign. The default is the Unicode per mille character (‰).

zero-digit=”character”
The optional zero-digit attribute defines what character is used to represent the digit zero. The default is (0).
Code fragment below, shows how to format for European currency:
<xsl:decimal-format name=”euro_currency” decimal-separator=”,” grouping-separator=”.”>
Source code for xsl_decimal_format.xsl:
<xsl:stylesheet xmlns:xsl=

"http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:decimal-format name="staff" digit="D" />



<xsl:template match="/">

<html>

<body>



<xsl:value-of select='format-number(123456789, "#.000")' />

</body>



</html>



</xsl:template>

</xsl:stylesheet>