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

DecimalFormat method format loses precision for doubles

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P1 P1
    • 1.1.4
    • 1.1, 1.1.2
    • core-libs
    • 1.1.4
    • x86, sparc
    • solaris_2.5.1, windows_95, windows_nt
    • Not verified

      import java.text.*;

      public class bug {
        public static void main(String[] args) {

          DecimalFormat nf = new DecimalFormat("##,###,###.00");
          System.out.println(nf.format(1.13));
        }
      }

      Should print 1.13 but displays 1.12

            nlindenbsunw Norbert Lindenberg (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: