commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ben Tels (JIRA)" <>
Subject [jira] [Commented] (LANG-674) NumberUtils and decimal point characte
Date Sat, 03 Sep 2011 21:11:10 GMT


Ben Tels commented on LANG-674:

I have to say I agree with Stevo that something is rotten in the state of Denmark with this
one. True, what exactly is wrong depends on your point of view, but it is definitely something.

If, as Stephen says, the semantics of NumberUtils should match those of Java sourcecode, then
the simple problem is that the documentation on the methods in NumberUtils doesn't SAY that.
Or otherwise doesn't say that you're supposed to use input formatted according to the en_US

>From a different point of view, the (larger) problem may indeed be that the NumberUtils
methods do not take locale into account. In the nl locale, as Stevo says, the value "123,4"
is a valid number equivalent to 1234/10.

Perhaps a good solution is to do both: overload all the methods that take String arguments
to take a Locale argument as well, then put in the documentation that the existing methods
implicitly use locale en_US.

> NumberUtils and decimal point characte
> --------------------------------------
>                 Key: LANG-674
>                 URL:
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.math.*
>            Reporter: Henri Yandell
>             Fix For: 3.x
> Stevo Slavić reports on commons-user:
> Is there any valid reason why '.' is hardcoded as decimal point
> character in lang.math.NumberUtils, commons-lang (2.6) ? Shouldn't
> this be locale dependent?

This message is automatically generated by JIRA.
For more information on JIRA, see:


View raw message