From 5b3218c205b40c2bcd574ad5c24bd6e79892f23d Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 14 Oct 2024 20:37:41 +0100 Subject: [PATCH] fix acc chart --- .../src/components/player/chart/player-accuracy-chart.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/projects/website/src/components/player/chart/player-accuracy-chart.tsx b/projects/website/src/components/player/chart/player-accuracy-chart.tsx index 710400c..6c01343 100644 --- a/projects/website/src/components/player/chart/player-accuracy-chart.tsx +++ b/projects/website/src/components/player/chart/player-accuracy-chart.tsx @@ -4,6 +4,7 @@ import React from "react"; import { DatasetConfig } from "@/components/chart/generic-chart"; import GenericPlayerChart from "@/components/player/chart/generic-player-chart"; import ScoreSaberPlayer from "@ssr/common/types/player/impl/scoresaber-player"; +import { isWholeNumber } from "@ssr/common/utils/number-utils"; type Props = { player: ScoreSaberPlayer; @@ -22,6 +23,12 @@ const datasetConfig: DatasetConfig[] = [ hideOnMobile: false, displayName: "Average Ranked Accuracy", position: "left", + valueFormatter: value => { + if (isWholeNumber(value)) { + return value.toString(); + } + return value.toFixed(1); + }, }, labelFormatter: (value: number) => `Average Ranked Accuracy ${value.toFixed(3)}%`, },