example: Fix the RibbonSpinBox's 'Binding loop detected for property text' warning.
This commit is contained in:
parent
8c10f7a463
commit
f730eb0ee3
|
@ -407,12 +407,14 @@ RibbonWindow {
|
||||||
validator: DoubleValidator {
|
validator: DoubleValidator {
|
||||||
bottom: Math.min(spinbox.from, spinbox.to)
|
bottom: Math.min(spinbox.from, spinbox.to)
|
||||||
top: Math.max(spinbox.from, spinbox.to)
|
top: Math.max(spinbox.from, spinbox.to)
|
||||||
|
decimals: 2
|
||||||
|
notation: DoubleValidator.StandardNotation
|
||||||
}
|
}
|
||||||
textFromValue: function(value, locale) {
|
textFromValue: function(value, locale) {
|
||||||
return Number(value / 100).toLocaleString(locale, 'f', 2)
|
return Number(value / 100).toLocaleString(locale, 'f', 2)
|
||||||
}
|
}
|
||||||
valueFromText: function(text, locale) {
|
valueFromText: function(text, locale) {
|
||||||
return Number.fromLocaleString(locale, text) * 100
|
return Math.round(Number.fromLocaleString(locale, text) * 100)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue