Add percent to folder showcase stats.

This commit is contained in:
zkldi
2021-12-12 01:56:07 +00:00
parent fc4a9184bf
commit 0994f93061
2 changed files with 8 additions and 3 deletions
@@ -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({
</h5>
<h4>
{result.value}
{/* @ts-expect-error temp */}
<small className="text-muted">/{result.outOf}</small>
<small className="text-muted">
{/* @ts-expect-error This property definitely exists.*/}
{/* */}/{result.outOf} ({ToPercent(result.value, result.outOf)})
</small>
</h4>
{user && user.id !== reqUser.id && (
+3
View File
@@ -197,3 +197,6 @@ export function HistorySafeGoBack(history: ReturnType<typeof useHistory>) {
// history.goBack();
// }
}
export function ToPercent(n1: number, n2: number) {
return `${((100 * n1) / n2).toFixed(2)}%`;
}