From fb3837ea0a2fa12566a613add320c425861c6607 Mon Sep 17 00:00:00 2001 From: keyan Date: Mon, 18 Sep 2023 18:09:08 -0500 Subject: [PATCH] use number formatting more places --- components/hidden-wallet-summary.js | 2 +- components/item-full.js | 2 +- components/user-header.js | 5 ++++- pages/wallet.js | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/components/hidden-wallet-summary.js b/components/hidden-wallet-summary.js index 1cb98552..c28cba2b 100644 --- a/components/hidden-wallet-summary.js +++ b/components/hidden-wallet-summary.js @@ -18,7 +18,7 @@ export default function HiddenWalletSummary ({ abbreviate, fixedWidth }) { ref={ref} style={{ width: fixedWidth ? width : undefined }} className='d-inline-block text-monospace' align='right' onPointerEnter={() => setHover(true)} onPointerLeave={() => setHover(false)} > - {hover ? (abbreviate ? abbrNum(me.sats) : numWithUnits(me.sats, { abbreviate: false })) : '******'} + {hover ? (abbreviate ? abbrNum(me.sats) : numWithUnits(me.sats, { abbreviate: false, format: true })) : '******'} ) } diff --git a/components/item-full.js b/components/item-full.js index dbcfead7..84431731 100644 --- a/components/item-full.js +++ b/components/item-full.js @@ -145,7 +145,7 @@ function TopLevelItem ({ item, noReply, ...props }) { {item.bountyPaidTo?.length ? (
- {numWithUnits(item.bounty, { abbreviate: false })} paid + {numWithUnits(item.bounty, { abbreviate: false, format: true })} paid {item.bountyPaidTo.length > 1 && {item.bountyPaidTo.length} times}
) : ( diff --git a/components/user-header.js b/components/user-header.js index a62ecfc8..68b909a3 100644 --- a/components/user-header.js +++ b/components/user-header.js @@ -180,7 +180,10 @@ function HeaderHeader ({ user }) { const showModal = useShowModal() const isMe = me?.name === user.name - const Satistics = () =>
{user.stacked} stacked
+ const Satistics = () => ( +
+ {numWithUnits(user.stacked, { abbreviate: false, format: true })} stacked +
) const lnurlp = encodeLNUrl(new URL(`https://stacker.news/.well-known/lnurlp/${user.name}`)) return ( diff --git a/pages/wallet.js b/pages/wallet.js index a5ed2723..98ad918e 100644 --- a/pages/wallet.js +++ b/pages/wallet.js @@ -56,7 +56,7 @@ function YouHaveSats () { {me && ( me.hideWalletBalance ? - : numWithUnits(me.sats, { abbreviate: false }) + : numWithUnits(me.sats, { abbreviate: false, format: true }) )}