You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Jörg Uhlmann <jo...@gmx.de> on 2004/11/01 12:20:18 UTC

Localization in BigDecimal

Hello,
i tried to localized my BigDecimal InputFields and i found the follow 
behaviour. The Internal DecimalSymbol is set by the DefaultLocale:

class BigDecimalField
Method canonicalizeDecimalInput()
...
    DecimalFormatSymbols internal = new DecimalFormatSymbols();

The DefaultLocale is set on my system via Environment to the locale 
settings de_DE. (decimalseparator string ',')
The UserLocale  is also set to de_DE.

If i write a correct localized Input Field e.g. "1234,67", i get an 
NumberFormatException.
If i set the DefaultLocale via catalina.bat to US is the behaviour correct.
set CATALINA_OPTS=%CATALINA_OPTS% -Duser.language=en -Duser.region=US
 
I think the internal DecimalFormat should be set hard-coded to the us 
format with the DecimalFormatSymbols ('.' for Separator). Then there are 
no problems with the parse String.

Have everybody the same experience?

Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org