Compare commits
2 Commits
383f41f9ca
...
5b3218c205
Author | SHA1 | Date | |
---|---|---|---|
5b3218c205 | |||
8133d18ca2 |
@ -4,6 +4,7 @@ import React from "react";
|
|||||||
import { DatasetConfig } from "@/components/chart/generic-chart";
|
import { DatasetConfig } from "@/components/chart/generic-chart";
|
||||||
import GenericPlayerChart from "@/components/player/chart/generic-player-chart";
|
import GenericPlayerChart from "@/components/player/chart/generic-player-chart";
|
||||||
import ScoreSaberPlayer from "@ssr/common/types/player/impl/scoresaber-player";
|
import ScoreSaberPlayer from "@ssr/common/types/player/impl/scoresaber-player";
|
||||||
|
import { isWholeNumber } from "@ssr/common/utils/number-utils";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
player: ScoreSaberPlayer;
|
player: ScoreSaberPlayer;
|
||||||
@ -22,6 +23,12 @@ const datasetConfig: DatasetConfig[] = [
|
|||||||
hideOnMobile: false,
|
hideOnMobile: false,
|
||||||
displayName: "Average Ranked Accuracy",
|
displayName: "Average Ranked Accuracy",
|
||||||
position: "left",
|
position: "left",
|
||||||
|
valueFormatter: value => {
|
||||||
|
if (isWholeNumber(value)) {
|
||||||
|
return value.toString();
|
||||||
|
}
|
||||||
|
return value.toFixed(1);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
labelFormatter: (value: number) => `Average Ranked Accuracy ${value.toFixed(3)}%`,
|
labelFormatter: (value: number) => `Average Ranked Accuracy ${value.toFixed(3)}%`,
|
||||||
},
|
},
|
||||||
|
@ -55,7 +55,7 @@ export function PlayerRanking({ player, isCountry }: PlayerRankingProps) {
|
|||||||
weeklyRankChange >= 0 ? weeklyRankChange != 0 && "text-green-500" : "text-red-500"
|
weeklyRankChange >= 0 ? weeklyRankChange != 0 && "text-green-500" : "text-red-500"
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{weeklyRankChange}
|
{formatNumberWithCommas(weeklyRankChange)}
|
||||||
</td>
|
</td>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user