Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6609740

[Fmt-De] format error in DecimalFormat

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 5.0, 6u26
    • Fix Version/s: 10
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b09
    • CPU:
      x86
    • OS:
      windows_xp, windows_vista

      Description

      FULL PRODUCT VERSION :
      J2SE 1.4 J2SE 1.5

      ADDITIONAL OS VERSION INFORMATION :
      windows XP

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      nothing

      A DESCRIPTION OF THE PROBLEM :
      DecimalFormat format = new DecimalFormat("#,##0.0#; (#)");
      double number2 = -3456.349347;
      System.out.println(format.format(number2));

      Result expected is: (3,456.35)
      But I got : (3,456.35

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run the following code, will get wrong result:

      DecimalFormat format = new DecimalFormat("#,##0.0#; (#)");
      double number2 = -3456.349347;
      System.out.println(format.format(number2));

      Result expected is: (3,456.35)
      But I got : (3,456.35


      REPRODUCIBILITY :
      This bug can be reproduced always.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              nishjain Nishit Jain
              Reporter:
              okutsu Masayoshi Okutsu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: