mirror of https://github.com/espruino/BangleApps
Update app.js - Fixes small rounding bug
parent
02a5f81a0e
commit
ae174c6860
|
@ -143,10 +143,7 @@ function calculateValue(calculatedVariable, variableValues) {
|
||||||
|
|
||||||
// Round and trim long decimal numbers
|
// Round and trim long decimal numbers
|
||||||
if (!isInteger) {
|
if (!isInteger) {
|
||||||
calculatedValue = Math.round(calculatedValue * 1000) / 1000;
|
calculatedValue = calculatedValue.toFixed(3);
|
||||||
calculatedValue = calculatedValue.toString().replace(/(\.\d*?)0+$/, '$1');
|
|
||||||
} else {
|
|
||||||
calculatedValue = calculatedValue.toFixed(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let result = Object.entries(variableValues).map(function (entry) {
|
let result = Object.entries(variableValues).map(function (entry) {
|
||||||
|
|
Loading…
Reference in New Issue