diff options
author | smos <seth.mos@dds.nl> | 2012-05-23 20:25:27 +0200 |
---|---|---|
committer | smos <seth.mos@dds.nl> | 2012-05-23 20:25:27 +0200 |
commit | b45d6db6c42025678b964a0e94c978ba2939f4df (patch) | |
tree | d397dca7450bbeaadfeafb2fbcc5846c75157c17 | |
parent | 5e13bc843eda003cf1fc307b719ad040c419b673 (diff) | |
download | pfsense-b45d6db6c42025678b964a0e94c978ba2939f4df.zip pfsense-b45d6db6c42025678b964a0e94c978ba2939f4df.tar.gz |
Round off the values.
-rwxr-xr-x | usr/local/bin/3gstats.php | 8 |
1 files changed, 4 insertions, 4 deletions
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; } |