commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "charryong (JIRA)" <j...@apache.org>
Subject [jira] [Created] (LANG-1215) NumberUtils.createNumber() method lost precision sometimes
Date Thu, 31 Mar 2016 09:18:25 GMT
charryong created LANG-1215:
-------------------------------

             Summary: NumberUtils.createNumber() method lost precision sometimes
                 Key: LANG-1215
                 URL: https://issues.apache.org/jira/browse/LANG-1215
             Project: Commons Lang
          Issue Type: Bug
          Components: lang.math.*
    Affects Versions: 3.4, 2.6
         Environment: Windows 7,Jdk1.6,Eclipse 3.5
            Reporter: charryong
            Priority: Critical


For example:
    System.out.println(NumberUtils.createNumber("193343.82"));

The result  is   193343.81。

The bug because of  code in the class  NumberUtils of the org.apache.commons.lang3.math package。

    public static Float createFloat(final String str) {
        if (str == null) {
            return null;
        }
        return Float.valueOf(str);
    }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message