Bug 1242562 - Byte count rounding shouldn't depend on the decimal separator used. r=mak

Currently, download sizes on Fennec aren't rounded for locales using a "." as their decimal separator.

MozReview-Commit-ID: 54sBvTrNAln

--HG--
extra : transplant_source : %87%97%23W%7F%D2lQ%E7bYA5%AAa%A5%9BP%1FQ
This commit is contained in:
Jan Henning 2016-05-07 17:14:20 +02:00
Родитель 2a488ce1f3
Коммит 095e6a9c26
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -486,9 +486,12 @@ this.DownloadUtils = {
if (typeof Intl != "undefined") {
aBytes = getLocaleNumberFormat(fractionDigits)
.format(aBytes);
} else if (gDecimalSymbol != ".") {
} else {
// FIXME: Fall back to the old hack, will be fixed in bug 1200494.
aBytes = aBytes.toFixed(fractionDigits).replace(".", gDecimalSymbol);
aBytes = aBytes.toFixed(fractionDigits);
if (gDecimalSymbol != ".") {
aBytes = aBytes.replace(".", gDecimalSymbol);
}
}
}