Update percentage decimal places
This commit is contained in:
@ -1,3 +1,3 @@
|
||||
export default function formatPercent(n, fixed = 1) {
|
||||
return String((n.toPrecision(2) * 100).toFixed(fixed));
|
||||
export default function formatPercent(n, decimals = 1) {
|
||||
return (n * 100).toPrecision(decimals + 2);
|
||||
}
|
||||
|
Reference in New Issue
Block a user