Lua round() fix (tonumber returning nil), removed duplicated round() definition

This commit is contained in:
Alfredo Cardigliano 2018-11-30 12:00:00 +01:00
parent 356be040fc
commit 1691a1dd57
2 changed files with 1 additions and 7 deletions

View file

@ -753,12 +753,6 @@ end
-- print(_key .. "=" .. _value .. "\n")
--end
function round(num, idp)
if(num == nil) then return(0) end
return tonumber(string.format("%." .. (idp or 0) .. "f", num))
end
--function round(num) return math.floor(num+.5) end
function truncate(x)
return x<0 and math.ceil(x) or math.floor(x)
end