summaryrefslogtreecommitdiffstats
path: root/usr/local/bin/3gstats.php
diff options
context:
space:
mode:
Diffstat (limited to 'usr/local/bin/3gstats.php')
-rwxr-xr-xusr/local/bin/3gstats.php8
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;
}
OpenPOWER on IntegriCloud