-
Sub-task
-
Resolution: Unresolved
-
P4
-
None
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.
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.