add separators to all unabbreviated numbers
This commit is contained in:
parent
e6f6895ce0
commit
4b391dd6ee
|
@ -29,7 +29,7 @@ export default function Qr ({ asIs, value, useWallet: automated, statusVariant,
|
||||||
className='h-auto mw-100' value={qrValue} renderAs='svg' size={300}
|
className='h-auto mw-100' value={qrValue} renderAs='svg' size={300}
|
||||||
/>
|
/>
|
||||||
</a>
|
</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'>
|
<div className='mt-3 w-100'>
|
||||||
<CopyInput type='text' placeholder={value} readOnly noForm />
|
<CopyInput type='text' placeholder={value} readOnly noForm />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -36,12 +36,12 @@ export const numWithUnits = (n, {
|
||||||
abbreviate = true,
|
abbreviate = true,
|
||||||
unitSingular = 'sat',
|
unitSingular = 'sat',
|
||||||
unitPlural = 'sats',
|
unitPlural = 'sats',
|
||||||
format = false
|
format
|
||||||
} = {}) => {
|
} = {}) => {
|
||||||
if (isNaN(n)) {
|
if (isNaN(n)) {
|
||||||
return `${n} ${unitPlural}`
|
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) => {
|
export const fixedDecimal = (n, f) => {
|
||||||
|
|
Loading…
Reference in New Issue