mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 06:27:26 -06:00
Make getValue return an int if it's an integer number
This is a more generic solution to what's done in 7058ddbb66
.
Contributes to issue CURA-5491.
This commit is contained in:
parent
183cd0182d
commit
6977b8de6e
2 changed files with 9 additions and 6 deletions
|
@ -105,9 +105,12 @@ class Script:
|
|||
if m is None:
|
||||
return default
|
||||
try:
|
||||
return float(m.group(0))
|
||||
except:
|
||||
return default
|
||||
return int(m.group(0))
|
||||
except ValueError: #Not an integer.
|
||||
try:
|
||||
return float(m.group(0))
|
||||
except ValueError: #Not a number at all.
|
||||
return default
|
||||
|
||||
## Convenience function to produce a line of g-code.
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue