From http://www.w3schools.com (Copyright Refsnes Data)
Complete XSLT Function Reference
The format-number() function is used to convert a number into a string.
| string format-number(number,format,[decimalformat]) |
| Parameter | Description |
|---|---|
| number | Required. Specifies the number to be formatted |
| format | Required. Specifies the format pattern. Here are some of
the characters used in the formatting pattern:
|
| decimalformat | Optional. |
|
<?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <body> <xsl:value-of select='format-number(500100, "#")' /> <br /> <xsl:value-of select='format-number(500100, "0")' /> <br /> <xsl:value-of select='format-number(500100, "#.00")' /> <br /> <xsl:value-of select='format-number(500100, "#.0")' /> <br /> <xsl:value-of select='format-number(500100, "###,###.00")' /> <br /> <xsl:value-of select='format-number(0.23456, "#%")' /> </body> </html> </xsl:template> </xsl:stylesheet> |
View the XSL file and View the result.
Complete XSLT Function Reference
From http://www.w3schools.com (Copyright Refsnes Data)