JDK-8369050 : DecimalFormat roundingMode regression
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.text
  • Affected Version: 25
  • Priority: P3
  • Status: In Progress
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2025-10-01
  • Updated: 2025-10-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 26
26Unresolved
Related Reports
Relates :  
Description
java.text.DecimalFormat::setRoundingMode does not round input as specified by the rounding mode.
Regression: Last worked in version 21.0.8.

Sample :
import java.math.RoundingMode;
import java.text.DecimalFormat;

public class DecimalFormatExample {
    public static void main(String[] args) {
        DecimalFormat format = (DecimalFormat) DecimalFormat.getInstance();
        format.setMaximumFractionDigits(10);
        format.setRoundingMode(RoundingMode.HALF_UP);
        var expected = "0.0000000001";
        var actual = format.format(Double.parseDouble("0.00000000005"));
        if (!expected.equals(actual)) {
            throw new AssertionError("Expected: " + expected + ", Actual: " + actual);
        }
    }
}