feat(frontend): 🧹🧹🧹

This commit is contained in:
Dimitrie Stefanescu
2022-02-01 12:18:43 +00:00
parent 51c44ebe54
commit 7064280fd9
14 changed files with 26 additions and 40 deletions
@@ -0,0 +1,15 @@
import numeral from 'numeral'
export function formatNumber(value, max) {
const num = numeral(value)
const abs = Math.abs(max || num.value())
switch (abs) {
case abs < 1000:
return num.value()
case abs >= 1000 && abs <= 10000:
return num.format('0.0a')
default:
return num.format('0a')
}
}