struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Stair" <steve.st...@rrc.state.tx.us>
Subject Re: problem with vaidation of numeric field
Date Wed, 05 Mar 2003 17:10:10 GMT
> I have to validate a double field for input using
> struts validator,
> The problem is, in some places comma "," is used
> instead of decimal "." in double field, like
> 123.45 is same is 123,45 
> but in second case struts gives an error saying
> invalid double field, 
> can i make the existing validation work (double)or
> will have to write my own validation for it

If you follow the code back, to see how the parsing is being done,
you eventually get to

    GenericTypeValidator.formatDouble(String)

which just calls

    result = new Double(value);

So the real question is, "does Java accept "123,45" as a double
if locale is xx_XX?"  (Whatever locale you are using).



--
Steve Stair


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


Mime
View raw message