Update app.js - Fixed a small rounding error

pull/2794/head
stweedo 2023-06-04 00:53:14 -05:00 committed by GitHub
parent ae174c6860
commit 592b677788
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -144,6 +144,7 @@ function calculateValue(calculatedVariable, variableValues) {
// Round and trim long decimal numbers
if (!isInteger) {
calculatedValue = calculatedValue.toFixed(3);
calculatedValue = calculatedValue.replace(/\.0+$/, '').replace(/(\.\d*[1-9])0+$/, '$1');
}
let result = Object.entries(variableValues).map(function (entry) {