forked from qt-creator/qt-creator
QmlDesigner: Prevent rounding real numbers in Model Editor
Fixes: QDS-12021 Change-Id: I28215cc7a6ae9c388b3654799ef848a8002b0f13 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -96,6 +96,16 @@ Item {
|
||||
if (realField.activeFocus)
|
||||
realField.contentItem.focus = true
|
||||
}
|
||||
|
||||
textFromValue: function (value, locale) {
|
||||
locale.numberOptions = Locale.OmitGroupSeparator
|
||||
var decimals = realField.trailingZeroes ? realField.decimals : decimalCounter(realField.realValue)
|
||||
if (decimals > 0) {
|
||||
var text = Number(realField.realValue).toLocaleString(locale, 'f', decimals + 1)
|
||||
return text.substring(0, text.length - 1)
|
||||
}
|
||||
return Number(realField.realValue).toLocaleString(locale, 'f', decimals)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user