Fix more divide by zero issues (#14954)

* Fix more divide by zero issues
fixes: 14932

* Round to the nearest integer, then cast

* Fix up dhcpatriot
This commit is contained in:
Tony Murray
2023-04-11 13:44:45 -05:00
committed by GitHub
parent cde4d6a09f
commit e9c08e21a5
8 changed files with 37 additions and 34 deletions

View File

@@ -30,6 +30,7 @@ use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Illuminate\View\View;
use LibreNMS\Config;
use LibreNMS\Util\Number;
class GlobeController extends WidgetController
{
@@ -104,7 +105,7 @@ class GlobeController extends WidgetController
$location->lat,
$location->lng,
$location->location,
(1 - $up / $count) * 100, // percent down
Number::calculatePercent($count - $up, $count), // percent down
$count,
$down_items->implode(',<br/> '),
]);