diff --git a/billing-calculate.php b/billing-calculate.php index 0b5bc086c..6a6e6b18f 100755 --- a/billing-calculate.php +++ b/billing-calculate.php @@ -48,6 +48,8 @@ foreach (dbFetchRows("SELECT * FROM `bills` ORDER BY `bill_name`") as $bill) $type = "CDR"; $allowed = $bill['bill_cdr']; $used = $rate_data['rate_95th']; + $allowed_text = format_si($allowed)."bps"; + $used_text = format_si($used)."bps"; $overuse = $used - $allowed; $overuse = (($overuse <= 0) ? "0" : $overuse); $percent = round(($rate_data['rate_95th'] / $bill['bill_cdr']) * 100,2); @@ -56,11 +58,13 @@ foreach (dbFetchRows("SELECT * FROM `bills` ORDER BY `bill_name`") as $bill) $type = "Quota"; $allowed = $bill['bill_quota']; $used = $rate_data['total_data']; + $allowed_text = format_bytes_billing($allowed); + $used_text = format_bytes_billing($used); $overuse = $used - $allowed; $overuse = (($overuse <= 0) ? "0" : $overuse); $percent = round(($rate_data['total_data'] / $bill['bill_quota']) * 100,2); } - echo(strftime("%x @ %X", strtotime($datefrom))." to ".strftime("%x @ %X", strtotime($dateto))." ".str_pad($type,8)." ".str_pad($allowed,10)." ".str_pad($used,10)." ".$percent."%"); + echo(strftime("%x @ %X", strtotime($datefrom))." to ".strftime("%x @ %X", strtotime($dateto))." ".str_pad($type,8)." ".str_pad($allowed_text,10)." ".str_pad($used_text,10)." ".$percent."%"); if($i == '0') {