commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hasan Turksoy" <hturk...@gmail.com>
Subject Re: [validator] locale aware validator scripts required
Date Mon, 19 Feb 2007 16:17:31 GMT
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 <phidias51@yahoo.com> 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 <lists@steffen-heil.de>
> 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
>
>
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message