diff options
author | Ermal Luçi <eri@pfsense.org> | 2008-01-22 22:33:03 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2008-01-22 22:33:03 +0000 |
commit | 885da2ce25dd89cdfff10529e53d4ec5c2bee442 (patch) | |
tree | 958628b4c5d734acb9f8966a61d1cc4e2764d02a /usr | |
parent | 37f5fcf658d2237fe0a9d6d82fea3288208e3b29 (diff) | |
download | pfsense-885da2ce25dd89cdfff10529e53d4ec5c2bee442.zip pfsense-885da2ce25dd89cdfff10529e53d4ec5c2bee442.tar.gz |
Round up some values from divison calculations.
Diffstat (limited to 'usr')
-rw-r--r-- | usr/local/www/wizards/traffic_shaper_wizard.inc | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/usr/local/www/wizards/traffic_shaper_wizard.inc b/usr/local/www/wizards/traffic_shaper_wizard.inc index 506382e..d6ee754 100644 --- a/usr/local/www/wizards/traffic_shaper_wizard.inc +++ b/usr/local/www/wizards/traffic_shaper_wizard.inc @@ -698,14 +698,14 @@ $othersplist = array(); $tmpcf['red'] = "on"; if ($sched == "CBQ") { $tmpcf['borrow'] = "on"; - $tmpcf['bandwidth'] = $remainbw * 20/100; /* 20% bandwidth */ + $tmpcf['bandwidth'] = round($remainbw * 20/100, 2); /* 20% bandwidth */ $tmpcf['bandwidthtype'] = "%"; } else if ($sched == "HFSC" && 0) { - $tmpcf['bandwidth'] = $remainbw * 20/100; + $tmpcf['bandwidth'] = round($remainbw * 20/100, 2); $tmpcf['bandwidthtype'] = "%"; $tmpcf['realtime'] = "on"; - $tmpbw = $remainbw * 20/100; + $tmpbw = round($remainbw * 20/100, 2); $tmpcf['reatlime3'] = "{$tmpbw}%"; } array_push($tmppath, "qACK"); @@ -734,10 +734,10 @@ $othersplist = array(); $tmpcf['red'] = "on"; if ($sched == "CBQ") { $tmpcf['borrow'] = "on"; - $tmpcf['bandwidth'] = $remainbw * (10)/100; /* 10% bandwidth */ + $tmpcf['bandwidth'] = round($remainbw * (10)/100, 2); /* 10% bandwidth */ $tmpcf['bandwidthtype'] = "%"; } else if ($sched == "HFSC") { - $tmpcf['bandwidth'] = $remainbw * (10 + $factor)/100; /* 10% bandwidth */ + $tmpcf['bandwidth'] = round($remainbw * (10 + $factor)/100, 2); /* 10% bandwidth */ $tmpcf['bandwidthtype'] = "%"; } array_push($tmppath, "qDefault"); @@ -770,10 +770,10 @@ $othersplist = array(); } else { if ($sched == "CBQ") { $tmpcf['borrow'] = "on"; - $tmpcf['bandwidth'] = $remainbw * (5)/100; /* 5% bandwidth */ + $tmpcf['bandwidth'] = round($remainbw * (5)/100, 2); /* 5% bandwidth */ $tmpcf['bandwidthtype'] = "%"; } else if ($sched == "HFSC") { - $tmpcf['bandwidth'] = $remainbw * (5 + $factor)/100; /* 5% bandwidth */ + $tmpcf['bandwidth'] = round($remainbw * (5 + $factor)/100, 2); /* 5% bandwidth */ $tmpcf['bandwidthtype'] = "%"; } } @@ -799,7 +799,7 @@ $othersplist = array(); if ($voipbw > 0) $tmpcf['bandwidth'] = $voipbw; else - $tmpcf['bandwidth'] = $remainbw * (25)/100; /* 25% bandwidth */ + $tmpcf['bandwidth'] = round($remainbw * (25)/100, 2); /* 25% bandwidth */ $tmpcf['bandwidthtype'] = "%"; } else if ($sched == "HFSC") { if ($voipbw > 0) { @@ -814,7 +814,7 @@ $othersplist = array(); } else { $tmpcf['realtime'] = "on"; $r1 = 25 + $factor; - $voipbw = ($remainbw * (20 + $factor)/100); /* 20% bandwidth */ + $voipbw = round(($remainbw * (20 + $factor)/100), 2); /* 20% bandwidth */ $tmpcf['realtime1'] = "{$r1}%"; $tmpcf['realtime2'] = "30"; $tmpcf['realtime3'] = "{$voipbw}%"; @@ -842,12 +842,12 @@ $othersplist = array(); $tmpcf['red'] = "on"; if ($sched == "CBQ") { $tmpcf['borrow'] = "on"; - $tmpcf['bandwidth'] = $remainbw * (20)/100; /* 20% bandwidth */ + $tmpcf['bandwidth'] = round($remainbw * (20)/100, 2); /* 20% bandwidth */ $tmpcf['bandwidthtype'] = "%"; } else if ($sched == "HFSC") { $tmpcf['realtime'] = "on"; $g1 = 25 + $factor; - $gamesbw = ($remainbw * (20 + $factor)/100); /* 20% bandwidth */ + $gamesbw = round($remainbw * (20 + $factor)/100, 2); /* 20% bandwidth */ $tmpcf['realtime1'] = "{$g1}%"; $tmpcf['realtime2'] = "50"; $tmpcf['realtime3'] = "{$gamesbw}%"; @@ -874,11 +874,11 @@ $othersplist = array(); $tmpcf['red'] = "on"; if ($sched == "CBQ") { $tmpcf['borrow'] = "on"; - $tmpcf['bandwidth'] = $remainbw * (10)/100; /* 10% bandwidth */ + $tmpcf['bandwidth'] = round($remainbw * (10)/100, 2); /* 10% bandwidth */ $tmpcf['bandwidthtype'] = "%"; } else if ($sched == "HFSC") { $tmpcf['realtime'] = "on"; - $otherbw = $remainbw * (10 + $factor)/100; /* 10% bandwidth */ + $otherbw = round($remainbw * (10 + $factor)/100, 2); /* 10% bandwidth */ $tmpcf['realtime1'] = "{$otherbw}%"; $tmpcf['realtime3'] = "{$otherbw}%"; $tmpcf['bandwidth'] = $otherbw; @@ -905,13 +905,13 @@ $othersplist = array(); if ($penalty) $tmpcf['bandwidth'] = $penaltybw; else - $tmpcf['bandwidth'] = $remainbw * (5)/100; /* 5% bandwidth */ + $tmpcf['bandwidth'] = round($remainbw * (5)/100, 2); /* 5% bandwidth */ $tmpcf['bandwidthtype'] = "%"; } else if ($sched == "HFSC") { if ($penalty) $tmpcf['bandwidth'] = $penaltybw; else - $tmpcf['bandwidth'] = $remainbw * (5 + $factor)/100; /* 5% bandwidth */ + $tmpcf['bandwidth'] = round($remainbw * (5 + $factor)/100, 2); /* 5% bandwidth */ $tmpcf['bandwidthtype'] = "%"; } array_push($tmppath, "qOthersLow"); |