mirror of
https://github.com/edubart/otclient.git
synced 2025-04-30 01:29:21 +02:00
11 lines
211 B
Lua
11 lines
211 B
Lua
-- @docclass math
|
|
|
|
function math.round(num, idp)
|
|
local mult = 10^(idp or 0)
|
|
if num >= 0 then
|
|
return math.floor(num * mult + 0.5) / mult
|
|
else
|
|
return math.ceil(num * mult - 0.5) / mult
|
|
end
|
|
end
|