AlertSummary: Format trend change percent value

This commit is contained in:
Marius Hein 2014-10-09 09:31:03 +02:00
parent cc61dc2b01
commit c67e7c3ef0
1 changed files with 4 additions and 2 deletions

View File

@ -205,8 +205,10 @@ class Monitoring_AlertsummaryController extends Controller
} elseif ($yesterday === $today) {
$out->percent = 0;
} else {
$out->percent = 100 -
((100/($yesterday > $today ? $yesterday : $today)) * ($yesterday > $today ? $today : $yesterday));
$out->percent = sprintf(
'%.2f',
100 - ((100/($yesterday > $today ? $yesterday : $today)) * ($yesterday > $today ? $today : $yesterday))
);
}
return $out;