From 82780ba589a70e51d71ae62f08a9ffe4e6c08f6b Mon Sep 17 00:00:00 2001 From: SuperChamp234 Date: Sat, 15 Jan 2022 09:23:35 +0530 Subject: [PATCH] CSS changes for buttons, fixed numbers in stats --- src/view/App.tsx | 1 + src/view/Components/Statsview/index.tsx | 7 +++++-- styles.css | 10 ++++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) 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(?