mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
Lua round() fix (tonumber returning nil), removed duplicated round() definition
This commit is contained in:
parent
356be040fc
commit
1691a1dd57
2 changed files with 1 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue