<xsl:format-number(0.812345, '0.000')/>???
Stephane, 0001. for <xsl:value-of select="format-number(0.812345,
'0.000')"/> would certainly be incorrect. However:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:value-of select="format-number(0.812345, '0.000')"/>
<xsl:text> </xsl:text>
<xsl:value-of select="format-number(0.812345, '0.00%')"/>
</xsl:template>
</xsl:stylesheet>
Yields:
0.812
81.23%
for me, which seems correct. So I'm not sure what the explanation is for
your results.
-scott
"Stephane
Bailliez" To: <[EMAIL PROTECTED]>
<sbailliez@apa cc: (bcc: Scott Boag/CAM/Lotus)
che.org> Subject: decimal-format / format-number
regression ?
08/05/2001
01:05 PM
Please respond
to xalan-dev
Hi,
It looks like there is some kind of regression w/ format-number /
decimal-format, but I'm unsure if this is a regression or a stricter
conformance.
Thinking about it, it might be normal...
<xsl:format-number(0.812345, '0.000')/>
gives 0,812 w/ xalan 1.2.2
gives 0001. w/ xalan cvs
<xsl:format-number(0.812345, '0.00%')/>
gives 81,23% w/ xalan 1.2.2
gives 0081.% w/ xalan cvs
It works well if I define <xsl:decimal-format decimal-separator="."
grouping-separator="," />
It looks like in xalan 1, it was able to cope w/ a different separator than
the locale one when none was defined explicitely.
I can enter this as a bug if this is a real regression, just tell me.
Cheers,
Stephane