mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-28 23:19: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
|
|
@ -6,7 +6,7 @@ local format_utils = {}
|
|||
|
||||
function format_utils.round(num, idp)
|
||||
if(num == nil) then return(0) end
|
||||
return tonumber(string.format("%." .. (idp or 0) .. "f", num))
|
||||
return tonumber(string.format("%." .. (idp or 0) .. "f", num)) or 0
|
||||
end
|
||||
local round = format_utils.round
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue