Changed percentage data type

This commit is contained in:
Liam 2022-10-29 15:52:51 +01:00
parent 044a70fd6c
commit 260323b7d0
3 changed files with 8 additions and 8 deletions

@ -38,7 +38,7 @@ export default function ScoreStats() {
<div>
<p>Combo: {combo}</p>
<p>
{getFormattedScorePercent(percentage)} {percentage}%
{getFormattedScorePercent(percentage)} {percentage.toFixed(2)}%
</p>
{currentPP !== undefined ? <p>{currentPP.toFixed(0)}pp</p> : null}
</div>

@ -83,7 +83,7 @@ const handlers: any = {
const percent = relativeScore * 100;
state.setCurrentScore(finalScore);
state.setPercent(percent.toFixed(2));
state.setPercent(percent);
state.setPp(percent);
state.updateMapData(
@ -133,7 +133,7 @@ const handlers: any = {
const percent = relativeScore * 100;
state.setCurrentScore(finalScore);
state.setPercent(percent.toFixed(2));
state.setPercent(percent);
state.setCombo(data.status.performance.combo);
state.setPp(percent);
},

@ -20,7 +20,7 @@ interface SongDataState {
failed: boolean;
currentSongTime: number;
currentScore: number;
percentage: string;
percentage: number;
combo: number;
currentPP: number | undefined;
saberA: {
@ -45,7 +45,7 @@ interface SongDataState {
setFailed: (failed: boolean) => void;
setPaused: (paused: boolean) => void;
setCurrentScore: (score: number) => void;
setPercent: (percent: string) => void;
setPercent: (percent: number) => void;
setCombo: (combo: number) => void;
setPp: (percent: number) => void;
setInSong: (isInSong: boolean) => void;
@ -68,7 +68,7 @@ export const useSongDataStore = create<SongDataState>()((set) => ({
failed: false,
currentSongTime: 0,
currentScore: 0,
percentage: "100",
percentage: 100,
combo: 0,
currentPP: undefined,
saberA: {
@ -132,7 +132,7 @@ export const useSongDataStore = create<SongDataState>()((set) => ({
set({ currentScore: score });
},
setPercent: (percent: string) => {
setPercent: (percent: number) => {
set({ percentage: percent });
},
@ -178,7 +178,7 @@ export const useSongDataStore = create<SongDataState>()((set) => ({
failed: false,
currentSongTime: 0,
currentScore: 0,
percentage: "100",
percentage: 100,
combo: 0,
currentPP: undefined,
saberA: {