Martin:

> According to the PFD, if I'm running on J2SE 1.4 and I use a tag like this:
> 
> <fmt:formatNumber value="12.34" type="currency" currencyCode="GBP" />
> 
> I should see, I believe "(pound sign)12.34" in my browser. However, what I'm
> seeing is "GBP12.34" instead.

Hmm, I get the expected:

  £12.34 

Did you remember to set your browser's preferred locale to "en-GB",
or use <fmt:setLocale> with that locale?

I get "GBP12.34" only when running on J2SE 1.3, or when running on
J2SE 1.4 with a preferred locale other than "en-GB".

> This appears to be the case for any currency code I use except USD, when I
> see $12.34, as I would expect. (I discovered, though, that if I use J2SE 1.3
> instead, I get "USD12.34", so there's definitely some progress in moving to
> 1.4. :)
> 
> I tried specifying the numeric currency code instead, and the result was an
> exception, although the PFD doesn't state that only the character values for
> currency code are supported.
> 
> What am I doing wrong?

What exactly is the exception you are getting?

The tag handler calls java.util.Currency.getInstance() with the
specified currency code. This method throws an
IllegalArgumentException "if <code>currencyCode</code> is not a
supported ISO 4217 code" (quoted from the javadocs). This is what we
mention in the "Constraints" section of <fmt:formatNumber>. We do
not implement any additional constraints on the currency code.



Jan




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to