Re: problem with vaidation of numeric field

2003-03-05 Thread Steve Stair
> 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]



Re: problem with vaidation of numeric field

2003-03-05 Thread Jeff Kyser
Guess you could use a depends='mask' instead of double
and write a pattern that supported '.' or ',' in addition to
numbers
-jeff

On Wednesday, March 5, 2003, at 09:29  AM, Ashish Kulkarni wrote:

Hi,

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
Ashish



=
A$HI$H
__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


problem with vaidation of numeric field

2003-03-05 Thread Ashish Kulkarni
Hi,

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

Ashish



=
A$HI$H

__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]