diff --git a/src/view/App.tsx b/src/view/App.tsx index fdb748d..ed3e62c 100644 --- a/src/view/App.tsx +++ b/src/view/App.tsx @@ -34,6 +34,7 @@ class App extends React.Component { stats: { hp: 0, lvl: 0, + gold: 0, }, lastCron: "", }, diff --git a/src/view/Components/Statsview/index.tsx b/src/view/Components/Statsview/index.tsx index 6f5fc9e..506cae4 100644 --- a/src/view/Components/Statsview/index.tsx +++ b/src/view/Components/Statsview/index.tsx @@ -4,9 +4,12 @@ export default function Index(props: any) { return(
{/*
{props.user_data.profile.name}
*/} -
HP: {(props.user_data.stats.hp).toPrecision(3)}
+
HP: {numberWithCommas((props.user_data.stats.hp).toFixed(0))}
LEVEL: {props.user_data.stats.lvl}
-
GOLD: {(props.user_data.stats.gp).toPrecision(3)}
+
GOLD: {numberWithCommas(props.user_data.stats.gp.toFixed(2))}
); +} +function numberWithCommas(x: any) { + return x.toString().replace(/\B(?