Update percentage decimal places

This commit is contained in:
Michael Jackson
2019-02-25 22:20:30 -08:00
parent 5df576c6be
commit da7b915cca
2 changed files with 3 additions and 3 deletions

View File

@ -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);
}