Debug without decimal places

More
11 Aug 2020 12:06 #177887 by wudejo
Hi

I want to print a text with (DEBUG, xxxxx xxxx) and inside the text there is a variable. It will show the variable with 6 decimal places. Is there a way to cut it to no or only one decilmal place ?

Best
wudejo

Please Log in or Create an account to join the conversation.

More
11 Aug 2020 12:32 - 11 Aug 2020 12:33 #177890 by anfänger
You can use round first, this will give you the nearest integer.
Last edit: 11 Aug 2020 12:33 by anfänger.
The following user(s) said Thank You: wudejo

Please Log in or Create an account to join the conversation.

More
11 Aug 2020 12:51 #177892 by wudejo
Replied by wudejo on topic Debug without decimal places
Ok, thanks. But i don't understand exactly. Can you write me the syntax for that ?
Thank you...

Please Log in or Create an account to join the conversation.

More
11 Aug 2020 14:03 #177898 by anfänger
Take a look ad the G code overview of LinuxCNC

linuxcnc.org/docs/html/gcode/overview.html#gcode:functions

Should be something like this:

#<intvar> = ROUND[#yourparameter]

(DEBUG, xxxxx #<intvar> Xxxx )

Or something like this I can‘t test it now
The following user(s) said Thank You: wudejo

Please Log in or Create an account to join the conversation.

Time to create page: 0.075 seconds
Powered by Kunena Forum