struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Barefoot" <>
Subject RE: [validator] numbers with localized decimal separator
Date Wed, 15 Jan 2003 21:36:03 GMT

Seems like you'd only have to store the decimal separator for the locale you're currently
working with--the validator code, when it generates the JS, could just stick in the decimal
separator character for the locale in the last request as a variable, rather than creating
a variable for the locale itself.  No reason to store all the locales and match in JS when
you know the locale based on the previous request (in the validator code).  
Same behavior should apply to the thousands separator as well.


> -----Original Message-----
> From: Gemes Tibor []
> Sent: Wednesday, January 15, 2003 1:26 PM
> To: Struts Users Mailing List
> Subject: Re: [validator] numbers with localized decimal separator
> 2003-01-15, sze keltezéssel Rod McChesney ezt írta:
> > Sorry, I didn't understand that the javascript validation was
> > the problem. It does seem like the Java validator code should
> > be locale-sensitive, but that's a separate question.
> both
> > Since javascript number parsing does not handle locales, I guess
> > one approach would be to treat everything as a regex mask
> > instead of using the numeric validators, and include a
> > hashtable mapping from locale to expected pattern. The script
> > would look up the proper mask based on the locale. The locale
> > would also have to be stuck into the javascript as a variable.
> > I think that's similar to what you said, but would leave the
> > number in its native state.
> I was trying to say exactly the same but I failed. I think that most
> locales has the '.' separator, so I think that it is enough if the
> not-'.'-separator locales are stored in the script. 
> Sorry for my weak english. 
> Tib
> --
> To unsubscribe, e-mail:   
> <>
> For additional commands, e-mail: 
> <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message