Fix nan values. (#7340)

This commit is contained in:
Nicolo Maio 2023-03-27 13:57:39 +00:00
parent 55a6739ffd
commit 60ad82f4df

View file

@ -29,7 +29,7 @@ function network_utils.network2record(ifId, network)
local network_link = "<A HREF='"..ntop.getHttpPrefix()..'/lua/hosts_stats.lua?network='..network["network_id"].."' title='"..network["network_key"].."'>"..getFullLocalNetworkName(network["network_key"])..'</A>'
network["host_score_ratio"] = math.floor((network["score"] or 0) / (network["num_hosts"] or 0))
network["host_score_ratio"] = ternary(network["num_hosts"] and network["num_hosts"]>0, math.floor((network["score"] or 0) / (network["num_hosts"] or 0)) , '')
record["column_id"] = network_link
record["column_score"] = format_high_num_value_for_tables(network, "score")