Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-1215

NumberUtils.createNumber() method lost precision sometimes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Duplicate
    • 2.6, 3.4
    • None
    • lang.math.*
    • Windows 7,Jdk1.6,Eclipse 3.5

    • Important

    Description

      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);
      }

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              cylot charryong
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 72h
                  72h
                  Remaining:
                  Remaining Estimate - 72h
                  72h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified