3XC4L1B3R 0 Posted June 12, 2019 Share Posted June 12, 2019 I made a function that can check if a number should be rounded up or down, and returns the rounded number. It's pretty simple, but I wanted to share. function round(n) if n >= math.floor(n)+0.5 then n = math.ceil(n) else n = math.floor(n) end return n end for i = 1,10 do local r = math.random(1,99) / 10 print(r.." rounds to "..round(r)) end And I included a random number generator, if you want to test it. Quote Link to post Share on other sites