Fix error with compliant and assessed percentages format on the stats page (was showing more than 2 decimal places).

This commit is contained in:
Ryan Prather 2018-12-14 09:22:06 -05:00
parent 904f1e4655
commit 92cbf58145
No known key found for this signature in database
GPG Key ID: 66FDE2B4E8AB87A7

View File

@ -1501,6 +1501,7 @@ function get_hosts($cat_id = null)
}
foreach ($tgts as $tgt) {
/** @var target $tgt */
$chks = $db->get_Target_Checklists($tgt->get_ID());
$scan_srcs = $db->get_Target_Scan_Sources($tgt, $exp_scan_srcs);
$icons = [];
@ -1555,8 +1556,8 @@ function get_hosts($cat_id = null)
'cat_1' => $tgt->getCat1Count(),
'cat_2' => $tgt->getCat2Count(),
'cat_3' => $tgt->getCat3Count(),
'comp' => $tgt->getCompliantPercent(),
'assessed' => $tgt->getAssessedPercent()
'comp' => floatval(number_format($tgt->getCompliantPercent(), 6)),
'assessed' => floatval(number_format($tgt->getAssessedPercent(), 6))
]);
}