mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 853706 - Backported fix for formatting 0 with significant digits from ICU, and add a warning about this backported fix to update-icu.sh. r=jwalden
--HG-- extra : rebase_source : e49fb499f2a193283533a10321a2b8c79edea8ba
This commit is contained in:
parent
a3eb8d6dbc
commit
bbe0596308
@ -1714,6 +1714,14 @@ DecimalFormat::subformat(UnicodeString& appendTo,
|
||||
appendTo.append(*grouping);
|
||||
handler.addAttribute(kGroupingSeparatorField, currentLength, appendTo.length());
|
||||
}
|
||||
}
|
||||
|
||||
// This handles the special case of formatting 0. For zero only, we count the
|
||||
// zero to the left of the decimal point as one signficant digit. Ordinarily we
|
||||
// do not count any leading 0's as significant. If the number we are formatting
|
||||
// is not zero, then either sigCount or digits.getCount() will be non-zero.
|
||||
if (sigCount == 0 && digits.getCount() == 0) {
|
||||
sigCount = 1;
|
||||
}
|
||||
|
||||
// TODO(dlf): this looks like it was a bug, we marked the int field as ending
|
||||
|
@ -14,6 +14,15 @@
|
||||
# and reapply it after running update-icu.sh (additional updates may be needed).
|
||||
# If the bug has been addressed, please delete this warning.
|
||||
|
||||
# Warning
|
||||
# =======
|
||||
# The fix for ICU bug 10045 has been individually backported into this tree.
|
||||
# If you update ICU to a version that does not have this fix yet, obtain the
|
||||
# patch "Backported fix for formatting 0 with significant digits from ICU" from
|
||||
# https://bugzilla.mozilla.org/show_bug.cgi?id=853706
|
||||
# and reapply it after running update-icu.sh.
|
||||
# If you update ICU to a version that has the fix, please delete this warning.
|
||||
|
||||
# Usage: update-icu.sh <URL of ICU SVN with release>
|
||||
# E.g., for ICU 50.1.1: update-icu.sh http://source.icu-project.org/repos/icu/icu/tags/release-50-1-1/
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user