Fixed common.php

This commit is contained in:
laf
2015-07-23 17:51:24 +01:00
530 changed files with 95669 additions and 87688 deletions
+16 -1
View File
@@ -726,7 +726,7 @@ function get_smokeping_files($device) {
}
}
return $smokeping_files;
}
} // end get_smokeping_files
function generate_smokeping_file($device,$file='') {
global $config;
@@ -738,3 +738,18 @@ function generate_smokeping_file($device,$file='') {
}
}
/*
* @return rounded value to 10th/100th/1000th depending on input (valid: 10, 100, 1000)
*/
function round_Nth($val = 0, $round_to) {
if (($round_to == "10") || ($round_to == "100") || ($round_to == "1000")) {
$diff = $val % $round_to;
if ($diff >= ($round_to / 2)) {
$ret = $val + ($round_to-$diff);
} else {
$ret = $val - $diff;
}
return $ret;
}
} // end round_Nth