From b45d6db6c42025678b964a0e94c978ba2939f4df Mon Sep 17 00:00:00 2001 From: smos Date: Wed, 23 May 2012 20:25:27 +0200 Subject: Round off the values. --- usr/local/bin/3gstats.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'usr') diff --git a/usr/local/bin/3gstats.php b/usr/local/bin/3gstats.php index 8e4e226..3140c4b 100755 --- a/usr/local/bin/3gstats.php +++ b/usr/local/bin/3gstats.php @@ -59,12 +59,12 @@ while(true) { $items = array(); $items = split(",", $elements[1]); $record['time'] = hexdec($items[0]); - $record['upstream'] = ((hexdec($items[1])) * 8) / 1024; - $record['downstream'] = ((hexdec($items[2])) * 8) / 1024; + $record['upstream'] = round((floatval(hexdec($items[1])) * 8) /1024); + $record['downstream'] = round((floatval(hexdec($items[2])) * 8) /1024); $record['sent'] = hexdec($items[3]); $record['received'] = hexdec($items[4]); - $record['bwupstream'] = ((hexdec($items[5])) * 8) / 1024; - $record['bwdownstream'] = ((hexdec($items[6])) * 8) / 1024; + $record['bwupstream'] = round((floatval(hexdec($items[5])) * 8) /1024); + $record['bwdownstream'] = round((floatval(hexdec($items[6])) * 8) /1024); break; } -- cgit v1.1