--四舍五入 function rounding(value) local positive = 1 if value < 0 then positive = -1 end value = math.abs(value) local int, decimal = math.modf(value) decimal = tostring(decimal * 10) decimal = string.sub(decimal, 1, 1) if tonumber(decimal) > 5 then int = int + 1 end return int * positive end