Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Nightly Builds
-
None
-
None
-
None
-
Operating System: other
Platform: Other
-
36878
Description
There's a bug in the validation code of formatFloat:
--snip--
if (num.doubleValue() >= (Float.MIN_VALUE * -1) &&
num.doubleValue() <= Float.MAX_VALUE)
--snip--
The lower border is checked against (Float.MIN_VALUE * -1). In contrast to
Integer.MIN_VALUE, Float.MIN_VALUE does not represent the minimum value, but the
smallest non-negative value. So the above check would crop all of the negative
values.
The same also applies to formatDouble.
There's also an issue with the delimiter which is used to mark powers of 10^3:
With Locale.US the following is accepted:
2.5 This is ok
2,500.0 This is ok
2,5.0 This is transformed into 25.0