diff --git a/src/checkAndEvaluateMath.ts b/src/checkAndEvaluateMath.ts index fd70454..26048af 100644 --- a/src/checkAndEvaluateMath.ts +++ b/src/checkAndEvaluateMath.ts @@ -128,8 +128,8 @@ function parseAndReduce(expr: string, fractionDigits = defaultFractionDigits): s } // the outer Number() gets rid of insignificant trailing zeros of decimal numbers - const reducedTo3Fixed = Number(Number.parseFloat(`${result}`).toFixed(fractionDigits)); - result = resultUnit ? `${reducedTo3Fixed}${resultUnit}` : reducedTo3Fixed; + const reducedToFixed = Number(Number.parseFloat(`${result}`).toFixed(fractionDigits)); + result = resultUnit ? `${reducedToFixed}${resultUnit}` : reducedToFixed; return result; }