marker 1 Posted October 20, 2013 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
Hypnomatic 10 Posted October 20, 2013 Round should do what you're looking for. _val= round 5.25; //result is 5 Share this post Link to post Share on other sites
IndeedPete 1038 Posted October 20, 2013 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
dr_strangepete 6 Posted October 20, 2013 theres also floor which returns the next lowest integer Share this post Link to post Share on other sites
nerdmod 11 Posted January 12, 2014 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
Tankbuster 1747 Posted January 12, 2014 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