You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Pons Rudy (JIRA)" <ji...@apache.org> on 2010/03/29 05:24:27 UTC

[jira] Updated: (HARMONY-6486) [classlib][luni] java.util.Formatter rounding error

     [ https://issues.apache.org/jira/browse/HARMONY-6486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pons Rudy updated HARMONY-6486:
-------------------------------

    Attachment: 6486-java6.patch

A patch for the java6 branch. It only calls DecimalFormat.setRoundingMode(RoundingMode.HALF_UP), and add regression tests.
Working on a java5 patch, but java5 don't have DecimalFormat.setRoundingMode.

> [classlib][luni] java.util.Formatter rounding error
> ---------------------------------------------------
>
>                 Key: HARMONY-6486
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6486
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Pons Rudy
>         Attachments: 6486-java6.patch
>
>
> Formatter use DecimalFormat to format numbers, with the default rounding mode (RoundingMode.HALF_EVEN) instead of RoundingMode.HALF_UP, ie System.out.printf("%.1f", 0.25); will print 0.2 instead of 0.3.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.