Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.1
-
None
Description
The NumberUtils.createNumber() method fails to check for multiple trailing characters, and as a result, it returns a value even though NumberUtils.isNumber() indicates that it should not. For example:
boolean isNumber = NumberUtils.isNumber("81.5514DD"); // returns false Number numValue = NumberUtils.createNumber("81.5514DD"); // returns a Double value, 81.5514
I would expect the createNumber() method to throw a NumberFormatException in this case.