From ae174c6860d7b0376b8d6e4d1675b566793c6778 Mon Sep 17 00:00:00 2001 From: stweedo <108593831+stweedo@users.noreply.github.com> Date: Sat, 3 Jun 2023 22:53:49 -0500 Subject: [PATCH] Update app.js - Fixes small rounding bug --- apps/ohmcalc/app.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/apps/ohmcalc/app.js b/apps/ohmcalc/app.js index 61ab4a0be..b0a28854b 100644 --- a/apps/ohmcalc/app.js +++ b/apps/ohmcalc/app.js @@ -143,10 +143,7 @@ function calculateValue(calculatedVariable, variableValues) { // Round and trim long decimal numbers if (!isInteger) { - calculatedValue = Math.round(calculatedValue * 1000) / 1000; - calculatedValue = calculatedValue.toString().replace(/(\.\d*?)0+$/, '$1'); - } else { - calculatedValue = calculatedValue.toFixed(0); + calculatedValue = calculatedValue.toFixed(3); } let result = Object.entries(variableValues).map(function (entry) {