This is deeper in the validation code, but I believe that
java.text.DecimalFormat should be used for float
or double parsing. Using Double d = new Double(string)
the way GenericTypeValidator does will not work right in other locales.
The javadoc for class Double says this in the secion on the
valueOf(String s) method:
To interpret localized string representations of a
floating-point value, use subclasses of NumberFormat.
HTH,
Rod
Gemes Tibor wrote:
2003. január 15. 10:42 dátummal Simon Kelly ezt írtad:
Btw are you aware of any other Locale in which the decimal separator is not
'.'?
Germany uses the ',' as well.
ok, so I assume this is a problem.
Do you think that is there any other way of validating float number input but
masking it with the pattern ^\d*(,\d*)?$ where the ',' should be replaced
with the localized decimal separator?
Tib
Oh, and this should parsed localized as well, and replaced each parseFloat
with this imho.
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>