Skip to content

Commit

Permalink
Update metric.php
Browse files Browse the repository at this point in the history
Fix: PHP Fatal error: Uncaught TypeError: number_format(): Argument ganglia#1 ($num) must be of type float, string given in /usr/share/ganglia/graph.d/metric.php:58
  • Loading branch information
berlin2123 authored May 4, 2024
1 parent 579442e commit 465e753
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions graph.d/metric.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ function graph_metric ( &$rrdtool_graph ) {
}

$prefix = $summary ? $metricname : $hostname;
$value = (float)$value;
$value = ($value > 1000)
? number_format($value)
: number_format($value, 2);
Expand Down

0 comments on commit 465e753

Please sign in to comment.