Skip to content

Commit 1729aeb

Browse files
committed
don't remove decimal from floats
1 parent 5577d65 commit 1729aeb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/pygcode/dialects/linuxcnc.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ def _clean_codestr(value):
3030
return "%g" % value
3131

3232
CLEAN_NONE = lambda v: v
33-
CLEAN_FLOAT = lambda v: "{0:g}".format(round(v, 3))
33+
34+
def CLEAN_FLOAT(v):
35+
fstr = "{0:g}".format(round(v, 3))
36+
if '.' not in fstr:
37+
return fstr + '.'
38+
return fstr
3439
CLEAN_CODE = _clean_codestr
3540
CLEAN_INT = lambda v: "%g" % v
3641

0 commit comments

Comments
 (0)