From 664e497e8726dbee151d9703725e4bda8fcf5f36 Mon Sep 17 00:00:00 2001 From: Liam <67254223+RealFascinated@users.noreply.github.com> Date: Sat, 29 Oct 2022 11:14:03 +0100 Subject: [PATCH] Fix number formatting --- src/components/PlayerStats.js | 22 +++++++++++++++++++--- src/components/ScoreStats.js | 7 ++++++- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/components/PlayerStats.js b/src/components/PlayerStats.js index 4a7c4b0..ca3160c 100644 --- a/src/components/PlayerStats.js +++ b/src/components/PlayerStats.js @@ -46,7 +46,11 @@ const PlayerStats = () => {

- {pp}pp{" "} + {pp.toLocaleString("en-us", { + maximumSignificantDigits: 2, + minimumSignificantDigits: 2, + })} + pp{" "} { ({leaderboardType})

-

#{globalPos}

+

+ # + {globalPos.toLocaleString("en-us", { + maximumSignificantDigits: 2, + minimumSignificantDigits: 2, + })} +

-

#{countryRank}

+

+ # + {countryRank.toLocaleString("en-us", { + maximumSignificantDigits: 2, + minimumSignificantDigits: 2, + })} +

{percentage}

-

{currentScore.toLocaleString()}

+

+ {currentScore.toLocaleString("en-us", { + maximumSignificantDigits: 2, + minimumSignificantDigits: 2, + })} +

{currentPP !== undefined ?

{currentPP.toFixed(0)}pp

: null}

Average Cut