mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-08 06:23:59 -06:00
Round layer heights to 2 decimals
More difficult than I expected actually... Contributes to issue CURA-4655.
This commit is contained in:
parent
80f50dfff5
commit
93a3054af0
1 changed files with 14 additions and 4 deletions
|
@ -183,12 +183,22 @@ Item
|
|||
text:
|
||||
{
|
||||
var result = ""
|
||||
if(Cura.MachineManager.activeMachine != null){
|
||||
|
||||
var result = Cura.ProfilesModel.getItem(index).layer_height_without_unit
|
||||
if(Cura.MachineManager.activeMachine != null)
|
||||
{
|
||||
result = Cura.ProfilesModel.getItem(index).layer_height_without_unit
|
||||
|
||||
if(result == undefined)
|
||||
result = ""
|
||||
{
|
||||
result = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
result = Number(Math.round(result + "e+2") + "e-2"); //Round to 2 decimals. Javascript makes this difficult...
|
||||
if (result == undefined || result != result) //Parse failure.
|
||||
{
|
||||
result = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue