mirror of
https://github.com/edubart/otclient.git
synced 2025-10-17 21:13:26 +02:00
Refactor for documentation
This commit is contained in:
10
modules/corelib/math.lua
Normal file
10
modules/corelib/math.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
-- @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
|
Reference in New Issue
Block a user