its in the title but I need a round function that rounds. The old one I used just removed the decimal, which was not ideal so if anyone can help that will be Awesome
The first example would just be math.ceil, the second one would be math.floor. But if youβre looking for rounding to the nearest integer then just use:
local function round(n)
return math.floor(n + 0.5)
end
print(round(1.67)) -- 2
print(round(1.36)) -- 1