From 349290a03710b73feb31d8adb17a6fc69cfc3086 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Mon, 12 Dec 2011 12:16:57 +0000 Subject: [PATCH] fix billing-calculate strings git-svn-id: http://www.observium.org/svn/observer/trunk@2773 61d68cd4-352d-0410-923a-c4978735b2b8 --- billing-calculate.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/billing-calculate.php b/billing-calculate.php index 0b5bc086ce..6a6e6b18f7 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') {