mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-28 23:29:03 +01:00
new number formatter
This commit is contained in:
parent
c543ae840a
commit
4fa57c1146
1 changed files with 3 additions and 6 deletions
|
@ -93,12 +93,9 @@ function IsJsonString(str) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function convert(value) {
|
function convert(value) {
|
||||||
if (value >= 1000000) {
|
return new Intl.NumberFormat('en-GB', {
|
||||||
value = value / 1000000 + "M";
|
notation: "compact"
|
||||||
} else if (value >= 1000) {
|
}).format(value);
|
||||||
value = value / 1000 + "K";
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
|
|
Loading…
Reference in a new issue