use number formatting more places

This commit is contained in:
keyan 2023-09-18 18:09:08 -05:00
parent 3a7c3f7af2
commit fb3837ea0a
4 changed files with 7 additions and 4 deletions

View File

@ -18,7 +18,7 @@ export default function HiddenWalletSummary ({ abbreviate, fixedWidth }) {
ref={ref} style={{ width: fixedWidth ? width : undefined }} ref={ref} style={{ width: fixedWidth ? width : undefined }}
className='d-inline-block text-monospace' align='right' onPointerEnter={() => setHover(true)} onPointerLeave={() => setHover(false)} 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 })) : '******'}
</span> </span>
) )
} }

View File

@ -145,7 +145,7 @@ function TopLevelItem ({ item, noReply, ...props }) {
{item.bountyPaidTo?.length {item.bountyPaidTo?.length
? ( ? (
<div className='px-3 py-1 d-inline-block bg-grey-medium rounded text-success'> <div className='px-3 py-1 d-inline-block bg-grey-medium rounded text-success'>
<Check className='fill-success' /> {numWithUnits(item.bounty, { abbreviate: false })} paid <Check className='fill-success' /> {numWithUnits(item.bounty, { abbreviate: false, format: true })} paid
{item.bountyPaidTo.length > 1 && <small className='fw-light'> {item.bountyPaidTo.length} times</small>} {item.bountyPaidTo.length > 1 && <small className='fw-light'> {item.bountyPaidTo.length} times</small>}
</div>) </div>)
: ( : (

View File

@ -180,7 +180,10 @@ function HeaderHeader ({ user }) {
const showModal = useShowModal() const showModal = useShowModal()
const isMe = me?.name === user.name const isMe = me?.name === user.name
const Satistics = () => <div className={`mb-2 ms-0 ms-sm-1 ${styles.username} text-success`}>{user.stacked} stacked</div> const Satistics = () => (
<div className={`mb-2 ms-0 ms-sm-1 ${styles.username} text-success`}>
{numWithUnits(user.stacked, { abbreviate: false, format: true })} stacked
</div>)
const lnurlp = encodeLNUrl(new URL(`https://stacker.news/.well-known/lnurlp/${user.name}`)) const lnurlp = encodeLNUrl(new URL(`https://stacker.news/.well-known/lnurlp/${user.name}`))
return ( return (

View File

@ -56,7 +56,7 @@ function YouHaveSats () {
<span className='text-monospace'>{me && ( <span className='text-monospace'>{me && (
me.hideWalletBalance me.hideWalletBalance
? <HiddenWalletSummary /> ? <HiddenWalletSummary />
: numWithUnits(me.sats, { abbreviate: false }) : numWithUnits(me.sats, { abbreviate: false, format: true })
)} )}
</span> </span>
</h2> </h2>