From 921d032e114ceb575de2dea58b392fabdf7cc0d5 Mon Sep 17 00:00:00 2001 From: Ibrahima Date: Sun, 20 Feb 2022 19:22:59 +0100 Subject: [PATCH 1/2] chore: show Millions with M --- src/Map.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Map.js b/src/Map.js index b5ece4c..63c8ed5 100644 --- a/src/Map.js +++ b/src/Map.js @@ -67,7 +67,9 @@ export default class Map { /** *************************** static *************************** */ static formatClusterText(count) { - if (count > 1000) { + if (count > 1000000) { + return `${(count / 1000000).toFixed(1)}M` + } else if (count > 1000) { return `${Math.floor(count / 1000)}K` } return count From 476fa3687598c5e5d762bfc330930e5c8bd18b83 Mon Sep 17 00:00:00 2001 From: Ibrahima Date: Wed, 23 Feb 2022 14:59:47 +0100 Subject: [PATCH 2/2] chore: show Millions with M --- src/Map.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Map.js b/src/Map.js index 63c8ed5..789fe80 100644 --- a/src/Map.js +++ b/src/Map.js @@ -67,9 +67,9 @@ export default class Map { /** *************************** static *************************** */ static formatClusterText(count) { - if (count > 1000000) { + if (count >= 1000000) { return `${(count / 1000000).toFixed(1)}M` - } else if (count > 1000) { + } else if (count >= 1000) { return `${Math.floor(count / 1000)}K` } return count