Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fout_conv #1

Open
mike-holmes opened this issue Mar 8, 2012 · 1 comment
Open

fout_conv #1

mike-holmes opened this issue Mar 8, 2012 · 1 comment

Comments

@mike-holmes
Copy link

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?

@chamnit
Copy link
Owner

chamnit commented Mar 8, 2012

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants