diff --git a/client/src/components/user/UGPTStatShowcase.tsx b/client/src/components/user/UGPTStatShowcase.tsx index 454972672..a61dcc96d 100644 --- a/client/src/components/user/UGPTStatShowcase.tsx +++ b/client/src/components/user/UGPTStatShowcase.tsx @@ -25,7 +25,7 @@ import { UGPTPreferenceStatsReturn } from "types/api-returns"; import { GamePT } from "types/react"; import { Playtype } from "types/tachi"; import { APIFetchV1 } from "util/api"; -import { UppercaseFirst } from "util/misc"; +import { ToPercent, UppercaseFirst } from "util/misc"; import UGPTStatContainer from "./UGPTStatContainer"; import UGPTStatCreator from "./UGPTStatCreator"; @@ -431,8 +431,10 @@ export function StatDisplay({

{result.value} - {/* @ts-expect-error temp */} - /{result.outOf} + + {/* @ts-expect-error This property definitely exists.*/} + {/* */}/{result.outOf} ({ToPercent(result.value, result.outOf)}) +

{user && user.id !== reqUser.id && ( diff --git a/client/src/util/misc.ts b/client/src/util/misc.ts index fefb8d715..7a61ee2d0 100644 --- a/client/src/util/misc.ts +++ b/client/src/util/misc.ts @@ -197,3 +197,6 @@ export function HistorySafeGoBack(history: ReturnType) { // history.goBack(); // } } +export function ToPercent(n1: number, n2: number) { + return `${((100 * n1) / n2).toFixed(2)}%`; +}