XSLT format-number function not formatting
===

I need to format a value to a specific format, but it doesn't appear as though its supported.

I want to use:

    format-number($value, '####,##,##,##0')

but the value returned when trying this is `'###,###,##0'`

So if I `$value = '123456789'` I want to have the value output as `1,24,56,789` but I am getting `123,456,789`.

Are there limitations on what formatting you can do?


If you go to [W3schools][1] and enter the following xml:

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!-- Edited by XMLSpy® -->
    <catalog>
    	<cd>
    		<title>Empire Burlesque</title>
    		<artist>Bob Dylan</artist>
    		<country>USA</country>
    		<company>Columbia</company>
    		<price>123456789</price>
    		<year>1985</year>
    	</cd>
    	<cd>
    		<title>Hide your heart</title>
    		<artist>Bonnie Tyler</artist>
    		<country>UK</country>
    		<company>CBS Records</company>
    		<price>123456789</price>
    		<year>1988</year>
    	</cd>
    	
    </catalog>

and then the following xsl:

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!-- Edited by XMLSpy® -->
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    
    <xsl:template match="/">
    <xsl:variable name="TestFormat" select="'###,##,##,##0'"/>
      <html>
      <body>
      <h2>My CD Collection</h2>
        <table border="1">
          <tr bgcolor="#9acd32">
            <th>Title</th>
            <th>Artist</th>
          </tr>
          <xsl:for-each select="catalog/cd">
          <tr>
            <td><xsl:value-of select="title"/></td>
            <td><xsl:value-of select="format-number(price, $TestFormat)"/></td>
          </tr>
          </xsl:for-each>
        </table>
      </body>
      </html>
    </xsl:template>
    </xsl:stylesheet>

you can see that I am not getting the desired format. Any suggestions?

Thanks in advance for any help.

  [1]: http://www.w3schools.com/xsl/tryxslt.asp?xmlfile=cdcatalog&xsltfile=cdcatalog