You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "charryong (JIRA)" <ji...@apache.org> on 2016/03/31 11:18:25 UTC

[jira] [Created] (LANG-1215) NumberUtils.createNumber() method lost precision sometimes

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)