Get the floor or ceiling for a number

Verified
Added by iNTERFACEWARE

Return the floor or ceiling for a number, using math.floor() or math.ceil()

Source Code
-- get the floor for a number
local floor = math.floor(99.5)
trace(floor)

-- get the ceiling for a number
local ceil = math.ceil(99.5)
trace(ceil)
Description
Return the floor or ceiling for a number, using math.floor() or math.ceil()
Usage Details

Demonstrates how to get the floor (next integer below) or ceiling (next integer above) for a number, using math.floor() or math.ceil()

How to use the snippet:

  • Paste the code into your script
  • Inspect the annotations to see how it works