mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-16 04:53:00 +00:00
8 lines
222 B
Lua
8 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
|