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

Bug in formatting large double values with more than.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.0
    • core-libs
    • x86
    • windows_nt



      Name: stC104175 Date: 04/14/2000


      Java Version JDK 1.2.2



      Formatting large double values with java.text.FormatDecimal changes the value
      that should be formatted. (see Screenshot).
      Formatting is done by

        void input_focusLost(FocusEvent e) {
          DecimalFormatSymbols symbols = new DecimalFormatSymbols();
          DecimalFormat decForm = new DecimalFormat("###,###,###.00", symbols);
          output.setText(decForm.format( new Float(input.getText()).floatValue()));
        }

      if you enter:
      '666333999000' the result is
      666,334,003,200.00
      (Review ID: 103694)
      ======================================================================

            nlindenbsunw Norbert Lindenberg (Inactive)
            stompkinsunw Sean Tompkins (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: