I have a debug statement in my gear cutting program to tell me what 
the program is about to do before I let it start cutting. (sometimes 
it can be a surprise)

Some of the variables are obviously integers. For instance the number 
of passes or the number of teeth.

I would like to be able to trim the zeros from the integer type 
variables but leave the multiple decimal places on the others.

Here is the statement

M0 (DEBUG, CUTTING #82 TEETH AT #1 DP #85 passes per tooth cut depth 
#7 on blank with OD #21)

displays as :

CUTTING 64.000000 TEETH AT 128.000000 DP 7.000000 passes per tooth 
cut depth 0.021450 on blank with OD 0.515625

where   #82 is the number of teeth in the gear
         #7 is the total depth from crest to root
         #1 is the calculated Diametrical pitch
         #85 is the number of cutting passes to make for each tooth
         #21 is the actual outside diameter of the blank

The debug statement works perfectly except that all the variables are 
carried out to several decimal places e.g. the number of teeth comes 
out as 64.000000.

I tried rounding the variable before the debug statement but they 
still come out with trailing zeros.  When I put the round function in 
the statement it just prints the round function as text and still 
displays the trailing zeros.


Is there a simple way to make the debug statement drop the trailing 
zeros when desired?

Thanks,
Cecil
          
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to