Merge pull request #1675 from thecashewtrader/number-format-respect-settings

Make numberFormat respect language and region settings
This commit is contained in:
Kavin 2022-11-03 17:11:37 +00:00 committed by GitHub
commit 99c4d65864
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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) {