diff --git a/scripts/jobs/cron_usage.inc.diskspace.php b/scripts/jobs/cron_usage.inc.diskspace.php index f8d183bf..19d2b826 100644 --- a/scripts/jobs/cron_usage.inc.diskspace.php +++ b/scripts/jobs/cron_usage.inc.diskspace.php @@ -37,9 +37,9 @@ while($row = $db->fetch_array($result)) $replace_arr = array( 'NAME' => $row['name'], - 'DISKAVAILABLE' => ($row['diskspace'] / 1024), /* traffic is stored in KB, template uses MB */ + 'DISKAVAILABLE' => round(($row['diskspace'] / 1024), 2), /* traffic is stored in KB, template uses MB */ 'DISKUSED' => round($row['diskspace_used'] / 1024, 2), /* traffic is stored in KB, template uses MB */ - 'USAGE_PERCENT' => ($row['diskspace_used'] * 100) / $row['diskspace'], + 'USAGE_PERCENT' => round(($row['diskspace_used'] * 100) / $row['diskspace'], 2), 'MAX_PERCENT' => $settings['system']['report_webmax'] ); diff --git a/scripts/jobs/cron_usage_report.php b/scripts/jobs/cron_usage_report.php index 4bd3b901..51a20e48 100644 --- a/scripts/jobs/cron_usage_report.php +++ b/scripts/jobs/cron_usage_report.php @@ -47,9 +47,9 @@ while($row = $db->fetch_array($result)) { $replace_arr = array( 'NAME' => $row['name'], - 'TRAFFIC' => ($row['traffic'] / 1024), /* traffic is stored in KB, template uses MB */ - 'TRAFFICUSED' => ($row['traffic_used'] / 1024), /* traffic is stored in KB, template uses MB */ - 'USAGE_PERCENT' => ($row['traffic_used'] * 100) / $row['traffic'], + 'TRAFFIC' => round(($row['traffic'] / 1024), 2), /* traffic is stored in KB, template uses MB */ + 'TRAFFICUSED' => round(($row['traffic_used'] / 1024), 2), /* traffic is stored in KB, template uses MB */ + 'USAGE_PERCENT' => round(($row['traffic_used'] * 100) / $row['traffic'], 2), 'MAX_PERCENT' => $settings['system']['report_trafficmax'] ); $lngfile = $db->query_first("SELECT `file` FROM `" . TABLE_PANEL_LANGUAGE . "` @@ -128,9 +128,9 @@ while($row = $db->fetch_array($result)) { $replace_arr = array( 'NAME' => $row['name'], - 'TRAFFIC' => ($row['traffic'] / 1024), /* traffic is stored in KB, template uses MB */ - 'TRAFFICUSED' => ($row['traffic_used_total'] / 1024), /* traffic is stored in KB, template uses MB */ - 'USAGE_PERCENT' => ($row['traffic_used_total'] * 100) / $row['traffic'], + 'TRAFFIC' => round(($row['traffic'] / 1024), 2), /* traffic is stored in KB, template uses MB */ + 'TRAFFICUSED' => round(($row['traffic_used_total'] / 1024), 2), /* traffic is stored in KB, template uses MB */ + 'USAGE_PERCENT' => round(($row['traffic_used_total'] * 100) / $row['traffic'], 2), 'MAX_PERCENT' => $settings['system']['report_trafficmax'] ); $lngfile = $db->query_first("SELECT `file` FROM `" . TABLE_PANEL_LANGUAGE . "`