> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to