math.floor(num)
math.ceil(num)
math.modf(num)
num = 12.4 print(math.floor(num)) 12 print(math.ceil(num)) 13
integer, decimal = math.modf(num) print(integer) 12 print(decimal) 0.4
lua浮点数取整
原文:https://www.cnblogs.com/zhugaopeng/p/10153059.html