abbr wallet at 10k
This commit is contained in:
parent
c7ae5dc8ac
commit
46162f4162
|
@ -13,8 +13,8 @@ import { useEffect, useState } from 'react'
|
|||
import { randInRange } from '../lib/rand'
|
||||
|
||||
const formatSats = n => {
|
||||
if (n < 1e3) return n
|
||||
if (n >= 1e3 && n < 1e6) return +(n / 1e3).toFixed(1) + 'k'
|
||||
if (n < 1e4) return n
|
||||
if (n >= 1e4 && n < 1e6) return +(n / 1e3).toFixed(1) + 'k'
|
||||
if (n >= 1e6 && n < 1e9) return +(n / 1e6).toFixed(1) + 'm'
|
||||
if (n >= 1e9 && n < 1e12) return +(n / 1e9).toFixed(1) + 'b'
|
||||
if (n >= 1e12) return +(n / 1e12).toFixed(1) + 't'
|
||||
|
|
Loading…
Reference in New Issue