[Fmt-De] format error in DecimalFormat

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 10
    • Affects Version/s: 5.0, 6u26
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: