mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-28 23:19:33 +00:00
Fixes inteface speed visualization with non-needed decimals
This commit is contained in:
parent
f4aa1b7072
commit
b364116e7b
3 changed files with 2 additions and 24 deletions
|
|
@ -178,26 +178,6 @@ function format_utils.bitsToSize(bits)
|
|||
return(bitsToSizeMultiplier(bits, 1000))
|
||||
end
|
||||
|
||||
-- maxRateToString
|
||||
function format_utils.maxRateToString(max_rate)
|
||||
if((max_rate == nil) or (max_rate == "")) then max_rate = -1 end
|
||||
max_rate = tonumber(max_rate)
|
||||
|
||||
if(max_rate < 1000) then
|
||||
return(max_rate.." Kbit/s")
|
||||
else
|
||||
local mr
|
||||
mr = round(max_rate / 1000, 2)
|
||||
|
||||
if(mr < 1000) then
|
||||
return(mr.." Mbit/s")
|
||||
else
|
||||
gbit = mr /1000
|
||||
return(gbit.." Gbit/s")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function format_utils.formatEpoch(epoch)
|
||||
if epoch == 0 then
|
||||
return("")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue