From c412be84512b12ebd90d3c83630eadb159723ffb Mon Sep 17 00:00:00 2001 From: Ashley Date: Thu, 22 Sep 2022 16:25:31 +0200 Subject: [PATCH] new number formatter --- server.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/server.js b/server.js index 346df3e0..bcad37e0 100644 --- a/server.js +++ b/server.js @@ -93,12 +93,9 @@ function IsJsonString(str) { } function convert(value) { - if (value >= 1000000) { - value = value / 1000000 + "M"; - } else if (value >= 1000) { - value = value / 1000 + "K"; - } - return value; +return new Intl.NumberFormat('en-GB', { + notation: "compact" +}).format(value); } /////////////////////////////////