mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Fixes round attempts on infinite numbers
This commit is contained in:
parent
af02c76c8b
commit
7f21b11dfb
1 changed files with 4 additions and 1 deletions
|
|
@ -12,7 +12,10 @@ function format_utils.round(num, idp)
|
|||
return 0
|
||||
end
|
||||
|
||||
if num == math.floor(num) then
|
||||
if math.abs(num) == math.huge then
|
||||
-- This is an infinite, e.g., 1/0 or -1/0
|
||||
res = num
|
||||
elseif num == math.floor(num) then
|
||||
-- This is an integer, so represent it
|
||||
-- without decimals
|
||||
res = string.format("%d", math.floor(num))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue