mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Billing fix a couple divide by zero errors (#13517)
* Billing fix a couple divide by zero errors In probably an ocean. * add missing space
This commit is contained in:
@@ -53,14 +53,14 @@ $in['data'] = format_bytes_billing($bill_data['total_data_in']);
|
||||
$in['allow'] = $total['allow'];
|
||||
$in['ave'] = format_bytes_billing(($bill_data['total_data_in'] / $cur_days));
|
||||
$in['est'] = format_bytes_billing(($bill_data['total_data_in'] / $cur_days * $total_days));
|
||||
$in['per'] = round(($bill_data['total_data_in'] / $bill_data['total_data'] * 100), 2);
|
||||
$in['per'] = ! empty($bill_data['total_data']) ? round(($bill_data['total_data_in'] / $bill_data['total_data'] * 100), 2) : 0;
|
||||
$in['bg'] = \LibreNMS\Util\Colors::percentage($in['per'], null);
|
||||
|
||||
$out['data'] = format_bytes_billing($bill_data['total_data_out']);
|
||||
$out['allow'] = $total['allow'];
|
||||
$out['ave'] = format_bytes_billing(($bill_data['total_data_out'] / $cur_days));
|
||||
$out['est'] = format_bytes_billing(($bill_data['total_data_out'] / $cur_days * $total_days));
|
||||
$out['per'] = round(($bill_data['total_data_out'] / $bill_data['total_data'] * 100), 2);
|
||||
$out['per'] = ! empty($bill_data['total_data']) ? round(($bill_data['total_data_out'] / $bill_data['total_data'] * 100), 2) : 0;
|
||||
$out['bg'] = \LibreNMS\Util\Colors::percentage($out['per'], null);
|
||||
|
||||
$ousage['over'] = ($bill_data['total_data'] - ($bill_data['bill_quota']));
|
||||
|
Reference in New Issue
Block a user