Scott, Gary, David,
(Gary, David, sorry to put you in CC, but my message took 2 days to appear
in the list...and right now I was isolated from the world for 4h because of
a router problem...so just in case...)

Gary, Thanks for clarifying my mail  I indeed was not very clear when
mentioning "different separator than the locale one". In that case it is a
French locale as you wrote.

And David as you pointed out, indeed the spec does not help much because of
the ambiguity between the "localized pattern" and the defaults... Also, I
mentioned in my mail that it was working fine w/ a decimal-format
declaration (ie the weird output was without the decimal-format declaration)

The problem is that in this case working with a format-number without
specifically redefining the decimal-format is like shooting yourself in the
foot. It does not make sense to specify a pattern where you will use the
separator and grouping characters...if you don't even know with which one
you are working one...ergh.

So as the default characters are supposed to be useful and save you some
trouble, it looks like Xalan 1.2.2 behavior is not totally incoherent..no
decimal-format is defined, thus it uses the default one to interpret the
pattern and the output is localized...

However what is supposed to be the behavior when a decimal-format does not
define all characters used in the pattern ? In this case it could simply
mean that we decided to go with the locale separators...

What do you think ?

----- Original Message -----
From: Gary L Peskin
To: [EMAIL PROTECTED]

Scott --
Try:
  java -Duser.region=fr -Duser.language=FR org.apache.xalan.xslt.Process
-xsl stylesheet-name
I was just looking at this too.  Great minds think alike.
I'm not sure if the format strings are supposed to vary by locale or
whether the symbols are fixed by the XSLT definition.  I was looking
into that when your email arrived.
Gary
[EMAIL PROTECTED] wrote:
>
> <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>&#10;</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





Reply via email to