mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-05 04:54:04 -06:00
Allow decimal point for values input in materials view
CURA-8684
This commit is contained in:
parent
29fc98fea4
commit
f62a5e7340
1 changed files with 2 additions and 2 deletions
|
@ -270,7 +270,7 @@ OldControls.TabView
|
|||
|
||||
valueFromText: function(text) {
|
||||
// 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);
|
||||
return Math.round(value * precision) / precision;
|
||||
}
|
||||
|
@ -298,7 +298,7 @@ OldControls.TabView
|
|||
|
||||
valueFromText: function(text, locale) {
|
||||
// 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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue