Make numberFormat respect language and region settings

This commit is contained in:
thecashewtrader 2022-11-03 22:13:41 +05:30
parent 01fb40463d
commit 33bb381035

View file

@ -88,7 +88,12 @@ const mixin = {
return str;
},
numberFormat(num) {
const formatter = Intl.NumberFormat(undefined, { notation: "compact" });
const formatter = Intl.NumberFormat(
`${this.getPreferenceString("hl")}-${this.getPreferenceString("region")}`,
{
notation: "compact",
},
);
return formatter.format(num);
},
addCommas(num) {