You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "Schaal, Roland" <R....@Verband.Creditreform.de> on 2006/11/08 09:57:39 UTC

Unexpected behavior of NumberConverter

Hello,
 
I have an input component which uses the f:convertNumber tag to convert
the input to a Number object.
 
When I type the value "x12345" it gives me a ConversionError as
expected.
But when I type the value "123x45" there is no ConversionError but it
converts this input to the Number "123" and cuts the rest of it. I would
also expect a ConversionError as this input is not a valid Number...?!
 
Can anyone confirm this to be a bug of the NumberConverter?
 
Looking into the source of NumberConverter I see that it uses
DecimalFormat to parse the input into Number which definitive cuts the
String value in the descibed way. Maybe there should also be a
verification for any character of the typed input string.
What do others think?
 
Regards,
Roland