locale, Wrong format string

2005-06-02 Thread Andreas Toom
Hello, I thought I finally hade the format/formatKey thing with 
bean:write figured out, but when I tried to switch from a en_US locale 
to a sv I get this exception:


org.apache.jasper.JasperException: Wrong format string: '#,##0'

I've read 
http://java.sun.com/j2se/1.4.2/docs/api/java/text/DecimalFormat.html and 
 I ran the code snippet generating format strings for currency, 
integers etc. and took my swedish format string (which is identical to 
en_US), it worked nice for my en_US (firefox default language setting) 
but not when I switched to swedish language settings or in IE with 
swedish region settings in the control panel.


I really need to solve this so any help would be really appreciated.

/Andreas


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



Re: locale, Wrong format string

2005-06-02 Thread Andreas Toom

The problem is solved:

After some examination of the source of the bean:write tag i found this:

  format = NumberFormat.getNumberInstance(locale);
  if (formatStrFromResources) {
   ((DecimalFormat) format).applyLocalizedPattern( 
  formatString);

  } else {
   ((DecimalFormat) format).applyPattern(formatString);
  }

That is, when the format string comes from a resource bundle the 
applyLocalizedPattern is used, so I have to make sure that the pattern I 
use i localized..


/Andreas


Andreas Toom wrote:
Hello, I thought I finally hade the format/formatKey thing with 
bean:write figured out, but when I tried to switch from a en_US locale 
to a sv I get this exception:


org.apache.jasper.JasperException: Wrong format string: '#,##0'

I've read 
http://java.sun.com/j2se/1.4.2/docs/api/java/text/DecimalFormat.html and 
 I ran the code snippet generating format strings for currency, integers 
etc. and took my swedish format string (which is identical to en_US), it 
worked nice for my en_US (firefox default language setting) but not when 
I switched to swedish language settings or in IE with swedish region 
settings in the control panel.


I really need to solve this so any help would be really appreciated.

/Andreas


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







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