Fix number formatting

This commit is contained in:
Liam 2022-10-29 11:14:03 +01:00
parent cd8f5adce3
commit 664e497e87
2 changed files with 25 additions and 4 deletions

@ -46,7 +46,11 @@ const PlayerStats = () => {
</div>
<div className={styles.playerStats}>
<p>
{pp}pp{" "}
{pp.toLocaleString("en-us", {
maximumSignificantDigits: 2,
minimumSignificantDigits: 2,
})}
pp{" "}
<span
style={{
fontSize: "23px",
@ -55,9 +59,21 @@ const PlayerStats = () => {
({leaderboardType})
</span>
</p>
<p>#{globalPos}</p>
<p>
#
{globalPos.toLocaleString("en-us", {
maximumSignificantDigits: 2,
minimumSignificantDigits: 2,
})}
</p>
<div className={styles.playerCountry}>
<p>#{countryRank}</p>
<p>
#
{countryRank.toLocaleString("en-us", {
maximumSignificantDigits: 2,
minimumSignificantDigits: 2,
})}
</p>
<ReactCountryFlag
className={styles.playerCountryIcon}
svg

@ -26,7 +26,12 @@ export default function ScoreStats() {
<div className={styles.scoreStats}>
<div className={styles.scoreStatsInfo}>
<p>{percentage}</p>
<p>{currentScore.toLocaleString()}</p>
<p>
{currentScore.toLocaleString("en-us", {
maximumSignificantDigits: 2,
minimumSignificantDigits: 2,
})}
</p>
{currentPP !== undefined ? <p>{currentPP.toFixed(0)}pp</p> : null}
</div>
<p className={styles.scoreStatsAverageCut}>Average Cut</p>