Skip to content

Commit

Permalink
chore: show Millions with M
Browse files Browse the repository at this point in the history
  • Loading branch information
iib0011 committed Feb 20, 2022
1 parent bde4cdf commit 921d032
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 921d032

Please sign in to comment.