preGrbl icon indicating copy to clipboard operation
preGrbl copied to clipboard

fout_conv

Open mike-holmes opened this issue 12 years ago • 1 comments

Sonny,

In an attempt to make sure I don't run into the problems we discussed (http://github.com/grbl/grbl/issues/74), I've had a go at integrating preGrbl into my python GUI (which I'll be making a repo for soon). However it doesn't seem to round the numbers, e.g. X100.00000 remains as-is.

I've played around with the 'ndigits' parameter and changed the unit_conv function to

def unit_conv(val) : # Converts value to mm
    if gc['inches_mode'] : val *= inch2mm
    return fout_conv(val) ### this line changed

but to no avail. Is there an easy modification to the code which would do the rounding?

mike-holmes avatar Mar 08 '12 13:03 mike-holmes

Sorry about this problem. I haven't worked on this code in a long while. Grbl's parser has since been updated with better error checking than this. Anyhow, I can't recall having this issue... the function round(x,n) should take a number and round it to n digits. I may have overlooked something in this code, and it might not be doing it correctly. I'll leave this issue open so it'll remind me to fix it when I can get some time.

chamnit avatar Mar 08 '12 14:03 chamnit