mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-22 23:42:59 +00:00
7 lines
222 B
Lua
7 lines
222 B
Lua
local we_c = worldeditadditions_commands
|
|
|
|
-- From http://lua-users.org/wiki/SimpleRound
|
|
function we_c.round(num, numDecimalPlaces)
|
|
local mult = 10^(numDecimalPlaces or 0)
|
|
return math.floor(num * mult + 0.5) / mult
|
|
end
|