After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 68759 - decimal-format doesn't seem to work properly
decimal-format doesn't seem to work properly
Status: VERIFIED FIXED
Product: libxslt
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
Daniel Veillard
Depends on:
Blocks:
 
 
Reported: 2002-01-15 12:28 UTC by jonathan.zaid
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description jonathan.zaid 2002-01-15 12:28:26 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>
Comment 1 Daniel Veillard 2002-02-10 14:06:35 UTC
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
Comment 2 Daniel Veillard 2002-02-12 08:33:30 UTC
This should be fixed in libxslt-1.0.12 released yesterday,

  thanks for the report,

Daniel