Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8362448 Make use of the Double.toString(double) algorithm in java.text.DecimalFormat
  3. JDK-8365690

Release Note: `java.text.DecimalFormat` Now Uses the `Double.toString(double)` Algorithm

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Unresolved
    • Icon: P4 P4
    • 26
    • None
    • core-libs

      Class `java.text.DecimalFormat` now uses the algorithm implemented in `Double.toString(double)` and in `java.util.Formatter` to format floating-point values.

      As a consequence, in rare cases the outcome might be slightly different than with the old algorithm. For example, the `double` 7.3879E20 now produces "738790000000000000000" rather than "738790000000000100000" given appropriate formatting specifications.

      To help migrating applications that might be impacted by this change, for a few releases the old algorithm will still be available to `DecimalFormat` and classes that depend on it, like `NumberFormat`. The old algorithm can be enabled with the "-Djdk.compat.DecimalFormat=true" option on the launcher command line. Absent this option, the new algorithm is used.

            rgiulietti Raffaello Giulietti
            rgiulietti Raffaello Giulietti
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: