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