Update app.js - Fixes small rounding bug

pull/2794/head
stweedo 2023-06-03 22:53:49 -05:00 committed by GitHub
parent 02a5f81a0e
commit ae174c6860
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 4 deletions

View File

@ -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) {