parent
69705d7bb9
commit
f1a3ecf997
|
@ -9,7 +9,7 @@ export const formatNumber = (n) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const parseNumber = (s) =>
|
export const parseNumber = (s) =>
|
||||||
parseInt(s.replace(/,/g, ''), 10)
|
parseInt(s.replace(/,/g, ''), 10) || 0
|
||||||
|
|
||||||
export const formatPercent = (n, fixed = 1) =>
|
export const formatPercent = (n, fixed = 1) =>
|
||||||
String((n.toPrecision(2) * 100).toFixed(fixed))
|
String((n.toPrecision(2) * 100).toFixed(fixed))
|
||||||
|
|
Loading…
Reference in New Issue