From 92cbf58145f47a2774d9e8ff7aa1d96e0c9d8c85 Mon Sep 17 00:00:00 2001 From: Ryan Prather Date: Fri, 14 Dec 2018 09:22:06 -0500 Subject: [PATCH] Fix error with compliant and assessed percentages format on the stats page (was showing more than 2 decimal places). --- ajax.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ajax.php b/ajax.php index e0f0c54..d0e859b 100644 --- a/ajax.php +++ b/ajax.php @@ -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)) ]); }