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:
Ghostkeeper 2018-07-09 09:01:52 +02:00
parent 183cd0182d
commit 6977b8de6e
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A
2 changed files with 9 additions and 6 deletions

View file

@ -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.
#