add separators to all unabbreviated numbers

This commit is contained in:
keyan 2024-07-31 17:45:15 -05:00
parent e6f6895ce0
commit 4b391dd6ee
2 changed files with 3 additions and 3 deletions

View File

@ -29,7 +29,7 @@ export default function Qr ({ asIs, value, useWallet: automated, statusVariant,
className='h-auto mw-100' value={qrValue} renderAs='svg' size={300}
/>
</a>
{description && <div className='mt-1 fst-italic text-center text-muted'>{description}</div>}
{description && <div className='mt-1 text-center text-muted'>{description}</div>}
<div className='mt-3 w-100'>
<CopyInput type='text' placeholder={value} readOnly noForm />
</div>

View File

@ -36,12 +36,12 @@ export const numWithUnits = (n, {
abbreviate = true,
unitSingular = 'sat',
unitPlural = 'sats',
format = false
format
} = {}) => {
if (isNaN(n)) {
return `${n} ${unitPlural}`
}
return `${abbreviate ? abbrNum(n) : format ? new Intl.NumberFormat().format(n) : n} ${n === 1 ? unitSingular : unitPlural}`
return `${abbreviate ? abbrNum(n) : !abbreviate || format === true ? new Intl.NumberFormat().format(n) : n} ${n === 1 ? unitSingular : unitPlural}`
}
export const fixedDecimal = (n, f) => {