Formatter is a one way of doing this... But i've used java.text.DecimalFormatSymbols class... like this:
Locale defaultLocale = context.getApplication().getDefaultLocale(); DecimalFormatSymbols symbols = new DecimalFormatSymbols(defaultLocale); then use this "symbols" varible to get needed symbols; symbols.getGroupingSeparator(); symbols.getDecimalSeparator(); .... no matter what we used to get symbols.. important point is the logic.. is it reasonable,, applicable or not? regards.. hasan.. On 2/19/07, Mark A Fortner <[EMAIL PROTECTED]> wrote:
Perhaps I misunderstood. <snip> > as a workaround solution; i changed ValidatorScript.java(of shale.jar).. it > assigns current locale's decimal and thousand seperator into two global > javascript variables.. > resolting code is like below: > var localeSpecificThousandSeperator = '.'; > var localeSpecificDecimalSeperator = ','; </snip> If you're changing the ValidatorScript.java class and using it to assign locale dependent separators, then it would be better to use the Formatter for this rather than having to maintain that code. Mark ----- Original Message ---- From: Steffen Heil <[EMAIL PROTECTED]> To: Jakarta Commons Users List <commons-user@jakarta.apache.org> Sent: Saturday, February 17, 2007 10:02:41 AM Subject: RE: [validator] locale aware validator scripts required Hi > You could probably use the java.util.Formatter class (which > is Locale-aware) to handle these types of formatting problems. In JavaScript ? :( Regards, Steffen