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