Answers for "math.floor round down lua"

Lua
5

lua round number

local number = 15.57
local number2 = 15.23

print(math.floor(number + 0.5)) --16
print(math.floor(number2 + 0.5)) --15
Posted by: Guest on December-04-2020
0

lua math floor

> = math.floor(0.5)
0
> = math.ceil(0.5)
1
> = math.floor(-0.5)
-1
> = math.ceil(-0.5)
-0
Posted by: Guest on October-20-2021

Browse Popular Code Answers by Language