mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Convert Virtual Machine pages to Laravel (#12287)
* Convert Virtual Machine pages to Laravel * wip * wip * wip * wip * wip * wip * delete * wip * wip * move powerStateLabel
This commit is contained in:
+2
-19
@@ -489,9 +489,7 @@ function formatRates($value, $round = '2', $sf = '3')
|
||||
|
||||
function formatStorage($value, $round = '2', $sf = '3')
|
||||
{
|
||||
$value = format_bi($value, $round) . 'B';
|
||||
|
||||
return $value;
|
||||
return \LibreNMS\Util\Rewrite::formatStorage($value, $round, $sf);
|
||||
}
|
||||
|
||||
function format_si($value, $round = '2', $sf = '3')
|
||||
@@ -527,22 +525,7 @@ function format_si($value, $round = '2', $sf = '3')
|
||||
|
||||
function format_bi($value, $round = '2', $sf = '3')
|
||||
{
|
||||
if ($value < '0') {
|
||||
$neg = 1;
|
||||
$value = $value * -1;
|
||||
}
|
||||
$sizes = ['', 'k', 'M', 'G', 'T', 'P', 'E'];
|
||||
$ext = $sizes[0];
|
||||
for ($i = 1; (($i < count($sizes)) && ($value >= 1024)); $i++) {
|
||||
$value = $value / 1024;
|
||||
$ext = $sizes[$i];
|
||||
}
|
||||
|
||||
if ($neg) {
|
||||
$value = $value * -1;
|
||||
}
|
||||
|
||||
return (number_format(round($value, $round), $sf, '.', '') + 0) . ' ' . $ext;
|
||||
return \LibreNMS\Util\Rewrite::format_bi($value, $round, $sf);
|
||||
}
|
||||
|
||||
function format_number($value, $base = '1000', $round = 2, $sf = 3)
|
||||
|
||||
Reference in New Issue
Block a user