daniel created this task.
daniel added projects: Wikidata, DataValues.
Herald added subscribers: Zppix, Aklapper.

TASK DESCRIPTION

DecimalFormat::roundToDigit uses DecimalFormat::roundDigits.
DecimalFormat::roundDigits( '1.45', 1 ) should return 1, but it returns 2.

The algorithm currently rounds iteratively, producing 1.45 -> 1.5 -> 2, which is wrong.
It should instead remember the first insignificant digit, and then replace all insignificant digits by 0.
Then it should "bump" the resulting number if the remembered digit was >= 5.

Thiemo found this when writing https://github.com/DataValues/Number/pull/68


TASK DETAIL
https://phabricator.wikimedia.org/T139748

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: daniel
Cc: thiemowmde, Aklapper, Zppix, daniel, D3r1ck01, Izno, Wikidata-bugs, aude, Mbch331
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to