Jump to content
Sign in to follow this  
marker

Distance in Metres without decimal points?

Recommended Posts

As the topic states, how do I return the distance without decimal places..

Obviously using distance to find the initial value, always returns something like 123.999, how would I return it to show 123 or 124?

Thanks

Share this post


Link to post
Share on other sites

You could go even more inaccurate if you want:

_val = (round (123.45 / 10)) * 10; // returns 120

Share this post


Link to post
Share on other sites

Maybe you have settled for one of the above solutions, but for future reference...

_Num = 1.9567;
_Num = (_Num - (_Num % 1));

Output: _Num = 1

Share this post


Link to post
Share on other sites
Maybe you have settled for one of the above solutions, but for future reference...

_Num = 1.9567;
_Num = (_Num - (_Num % 1));

Output: _Num = 1

That's interesting. Is there any documentation for the % thibg?

---------- Post added at 13:23 ---------- Previous post was at 13:13 ----------

Ignore. Found it in the biki.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×