mirror of
https://git.mirrors.martin98.com/https://github.com/petaflot/pygcode
synced 2025-06-04 11:25:20 +08:00
don't remove decimal from floats
This commit is contained in:
parent
5577d6560e
commit
1729aeb9be
@ -30,7 +30,12 @@ def _clean_codestr(value):
|
||||
return "%g" % value
|
||||
|
||||
CLEAN_NONE = lambda v: v
|
||||
CLEAN_FLOAT = lambda v: "{0:g}".format(round(v, 3))
|
||||
|
||||
def CLEAN_FLOAT(v):
|
||||
fstr = "{0:g}".format(round(v, 3))
|
||||
if '.' not in fstr:
|
||||
return fstr + '.'
|
||||
return fstr
|
||||
CLEAN_CODE = _clean_codestr
|
||||
CLEAN_INT = lambda v: "%g" % v
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user