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

NumberUtils.createNumber() method lost precision sometimes

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Duplicate
    • Affects Version/s: 2.6, 3.4
    • Fix Version/s: None
    • Component/s: lang.math.*
    • Labels:
    • Environment:

      Windows 7,Jdk1.6,Eclipse 3.5

    • Flags:
      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

              • Assignee:
                Unassigned
                Reporter:
                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