fix: apply formatNumber to adventurer, upgrade, and prestige panels

All cost/stat displays now respect the player's chosen number notation
format instead of rendering raw numbers or toLocaleString values.
This commit is contained in:
2026-03-06 20:00:46 -08:00
committed by Naomi Carrigan
parent 4e32709e07
commit 59c417e75e
3 changed files with 23 additions and 17 deletions
@@ -5,7 +5,7 @@ import { useGame } from "../../context/GameContext.js";
const PRESTIGE_THRESHOLD = 1_000_000;
export const PrestigePanel = (): React.JSX.Element => {
const { state, reload } = useGame();
const { state, reload, formatNumber } = useGame();
const [characterName, setCharacterName] = useState("");
const [isPending, setIsPending] = useState(false);
const [result, setResult] = useState<{ runestones: number; count: number } | null>(null);
@@ -42,10 +42,10 @@ export const PrestigePanel = (): React.JSX.Element => {
<div className="prestige-status">
<p>
Total gold earned:{" "}
<strong>{state.player.totalGoldEarned.toLocaleString()}</strong>
<strong>{formatNumber(state.player.totalGoldEarned)}</strong>
</p>
<p>
Required: <strong>{PRESTIGE_THRESHOLD.toLocaleString()}</strong>
Required: <strong>{formatNumber(PRESTIGE_THRESHOLD)}</strong>
</p>
<p>Current prestige count: <strong>{state.prestige.count}</strong></p>
<p>
@@ -82,7 +82,7 @@ export const PrestigePanel = (): React.JSX.Element => {
</div>
) : (
<p className="prestige-locked">
Earn {(PRESTIGE_THRESHOLD - state.player.totalGoldEarned).toLocaleString()} more
Earn {formatNumber(PRESTIGE_THRESHOLD - state.player.totalGoldEarned)} more
gold to unlock prestige.
</p>
)}