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

java.math.BigDecimal; DecimalFormat error after 15 digits

XMLWordPrintable

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



      Name: stC104175 Date: 06/30/2000


      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.
      Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

      Formatting of BigDecimal Numbers of more than 15 digits produce false result.
      Maybe the double Problem mentioned in: 4212074, 4106664, 4329840, 4330671
      reported against JDK 1.2.X

      DecimalFormat DFormat
      =(DecimalFormat) (NumberFormat.getNumberInstance(new Locale("en", "us")));
      DFormat.setDecimalSeparatorAlwaysShown(false);

      BigDecimal BD15=new BigDecimal("999999999999999");
      BigDecimal BD16=new BigDecimal("9999999999999999");

      System.out.println(DFormat.format(BD15));
      System.out.println(DFormat.format(BD16));

      999,999,999,999,999
      10,000,000,000,000,000
      (Review ID: 106749)
      ======================================================================

            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: