Jump to content




Pocket Calculator!


40 replies to this topic

#41 LDDestroier

  • Members
  • 1,095 posts
  • LocationACDC Town

Posted 12 November 2015 - 01:23 AM

math.floor() rounds down.
math.ceil() rounds up.
There isn't any standard function to round to the closest integer, but this'll work, methinks:
function round(number)
    return math.floor(number+0.5)
end






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users