mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-12-27 07:47:31 +01:00
6 lines
194 B
Lua
6 lines
194 B
Lua
-- From http://lua-users.org/wiki/SimpleRound
|
|
function worldeditadditions.round(num, numDecimalPlaces)
|
|
local mult = 10^(numDecimalPlaces or 0)
|
|
return math.floor(num * mult + 0.5) / mult
|
|
end
|