4 lines
118 B
JavaScript
4 lines
118 B
JavaScript
const formatPercent = (n, fixed = 1) => String((n.toPrecision(2) * 100).toFixed(fixed))
|
|
|
|
export default formatPercent
|