Fix QML spinbox not stepping for some values

This commit is contained in:
David Rowe 2021-01-16 11:04:07 +13:00 committed by Phil Palmer
parent 3b5eb2d24b
commit da2a3f67cf

View file

@ -97,11 +97,11 @@ SpinBox {
}
textFromValue: function(value, locale) {
return parseFloat(value / factor).toFixed(decimals);
return (value / factor).toFixed(decimals);
}
valueFromText: function(text, locale) {
return Number.fromLocaleString(locale, text) * factor;
return Math.round(Number.fromLocaleString(locale, text) * factor);
}