Code: Select all
function math.round(num, idp)
local mult = 10^(idp or 0)
return math.floor(num * mult + 0.5) / mult
end
math.round(x) = 8
y = 8.52
math.round(y) = 9
Code: Select all
function math.round(num, idp)
local mult = 10^(idp or 0)
return math.floor(num * mult + 0.5) / mult
end