2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-05 08:59:27 +08:00

FIX: makes sure [999500..999999] is correctly shown as 999k

This commit is contained in:
Joffrey JAFFEUX 2018-03-02 11:00:48 +01:00 committed by GitHub
parent 642c60c310
commit 6d4ff05cf0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -311,7 +311,7 @@ export function number(val) {
formattedNumber = I18n.toNumber(val / 1000000, {precision: 1});
return I18n.t("number.short.millions", {number: formattedNumber});
} else if (val > 99999) {
formattedNumber = I18n.toNumber(val / 1000, {precision: 0});
formattedNumber = I18n.toNumber(Math.floor(val / 1000), {precision: 0});
return I18n.t("number.short.thousands", {number: formattedNumber});
} else if (val > 999) {
formattedNumber = I18n.toNumber(val / 1000, {precision: 1});