Decimals Handling Improved

This commit is contained in:
Luis Fernando Molina committed 2020-08-21 17:33:27 +02:00
1 parent 90300e5cdc
commit eda2b14064
3 files changed
+16 -13

No files matched your search

+4 -2
View File
@@ -110,6 +110,7 @@ function newUiObject() {
let errorMessage = ''
let currentValue = 0
let valueMinDecimals = undefined
let currentPercentage = ''
let currentStatus = ''
let rightDragging = false
@@ -745,10 +746,11 @@ function newUiObject() {
hasError = false
}
function setValue(value, counter) {
function setValue(value, counter, minDecimals) {
if (value !== undefined) {
currentValue = value
hasValue = true
valueMinDecimals = minDecimals
if (counter !== undefined) {
valueCounter = counter
} else {
@@ -1438,7 +1440,7 @@ function newUiObject() {
label = currentValue
if (!isNaN(currentValue)) {
if (currentValue.toFixed !== undefined) {
label = dynamicDecimals(currentValue)
label = dynamicDecimals(currentValue, valueMinDecimals)
}
}