GNOME Bugzilla – Bug 68759
decimal-format doesn't seem to work properly
Last modified: 2009-08-15 18:40:50 UTC
Given the below code, I would expect the output to be: 123.456,22 Instead returned value is: 123,456,22 ----------------- Thanks once again. Jon ---------------------------------- <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" indent="yes" omit-xml-declaration="yes"/> <xsl:decimal-format name="ita" decimal-separator="," grouping- separator= "."/> <xsl:template match="/"> <xsl:value-of select="format-number(123456.22,'#.##0,##','ita')"/> </xsl:template> </xsl:stylesheet>
The "definition" of format number in the xSLT spec is horribly confusing and unclear. Moreover it depends on another spec which is not published as a standard (JDK 1.1 !), I assumed the '.' character to be used in the context of the formatting in your example comes from the grouping-separator value expressed for the ita decimal-format declaration. If that's right then I think I have a correct fix in CVS. If not, then please explain where that information is supposed to looked for, again the XSLT-1.0 spec is terribly confusing there. orchis:~/XSLT/xsltproc -> xsltproc tst.xsl tst.xsl 123.456,22 thanks for the report, Daniel
This should be fixed in libxslt-1.0.12 released yesterday, thanks for the report, Daniel