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

[Fmt-De] format error in DecimalFormat

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 10
    • 5.0, 6u26
    • core-libs
    • b09
    • x86
    • windows_xp, windows_vista

      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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: