Datasheet
RouterOS PHP class
168
if($data < $multi*$multi) {
return round($data/$multi, 1) . "k$postfix";
}
if($data < $multi*$multi*$multi) {
return round($data/$multi/$multi, 1) . "M$postfix";
}
return round($dat /$multi/$multi/$multi, 1) . "G$postfix";
}
function getTime() {
static $startTime;
if(!$startTime)
$startTime = microtime(TRUE);
return round(microtime(TRUE) - $startTime, 1);
}
function printTable($header, $line) {
$sizes = array();
foreach($header as $h)
$sizes[$h] = strlen($h);
foreach($line as $v)
foreach($header as $h)
$sizes[$h] = max($sizes[$h], strlen($v[$h]));
$out = "== ";
foreach($header as $h)
$out .= str_pad($h, $sizes[$h])." == ";
$out .= "\n";
foreach($line as $v) {
$out .= "-- ";
foreach($header as $h)
$out .= str_pad($v[$h], $sizes[$h])." -- ";
$out .= "\n";
}
return $out;
}
function printStatus() {
global $dests, $status, $current, $average, $percent;
ncurses_clear();
ncurses_move(0, 0);
ncurses_addstr("time: ".getTime()."\n\n");
$header = array("host", "speed", "proto", "status", "current", "average", "%");










