CSS changes for buttons, fixed numbers in stats
This commit is contained in:
parent
e4d3c78a9f
commit
82780ba589
3 changed files with 14 additions and 4 deletions
|
|
@ -34,6 +34,7 @@ class App extends React.Component<any, any> {
|
|||
stats: {
|
||||
hp: 0,
|
||||
lvl: 0,
|
||||
gold: 0,
|
||||
},
|
||||
lastCron: "",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -4,9 +4,12 @@ export default function Index(props: any) {
|
|||
return(
|
||||
<div className="stats">
|
||||
{/* <div id="profile-name">{props.user_data.profile.name}</div> */}
|
||||
<div className = "substats" id="hp">HP: {(props.user_data.stats.hp).toPrecision(3)}</div>
|
||||
<div className = "substats" id="hp">HP: {numberWithCommas((props.user_data.stats.hp).toFixed(0))}</div>
|
||||
<div className = "substats" id="lvl">LEVEL: {props.user_data.stats.lvl}</div>
|
||||
<div className = "substats" id="gold">GOLD: {(props.user_data.stats.gp).toPrecision(3)}</div>
|
||||
<div className = "substats" id="gold">GOLD: {numberWithCommas(props.user_data.stats.gp.toFixed(2))}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
function numberWithCommas(x: any) {
|
||||
return x.toString().replace(/\B(?<!\.\d*)(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue