mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 21:48:58 +08:00
Allow decimal point for values input in materials view
CURA-8684
This commit is contained in:
parent
29fc98fea4
commit
f62a5e7340
@ -270,7 +270,7 @@ OldControls.TabView
|
|||||||
|
|
||||||
valueFromText: function(text) {
|
valueFromText: function(text) {
|
||||||
// remove all non-number tokens from input string so value can be parsed correctly
|
// remove all non-number tokens from input string so value can be parsed correctly
|
||||||
var value = Number(text.replace(/[^0-9.-]+/g, ""));
|
var value = Number(text.replace(",", ".").replace(/[^0-9.-]+/g, ""));
|
||||||
var precision = Math.pow(10, spoolCostSpinBox.decimals);
|
var precision = Math.pow(10, spoolCostSpinBox.decimals);
|
||||||
return Math.round(value * precision) / precision;
|
return Math.round(value * precision) / precision;
|
||||||
}
|
}
|
||||||
@ -298,7 +298,7 @@ OldControls.TabView
|
|||||||
|
|
||||||
valueFromText: function(text, locale) {
|
valueFromText: function(text, locale) {
|
||||||
// remove all non-number tokens from input string so value can be parsed correctly
|
// remove all non-number tokens from input string so value can be parsed correctly
|
||||||
var value = Number(text.replace(/[^0-9.-]+/g, ""));
|
var value = Number(text.replace(",", ".").replace(/[^0-9.-]+/g, ""));
|
||||||
return Math.round(value);
|
return Math.round(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user