mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-25 17:53:44 +02:00
Complete move from old repository to new repository structure!
This commit is contained in:
@@ -32,6 +32,16 @@ if (! function_exists('human_readable')) {
|
||||
*/
|
||||
function human_readable($path, $precision = 2)
|
||||
{
|
||||
if (is_numeric($path)) {
|
||||
$i = 0;
|
||||
while (($path / 1024) > 0.9) {
|
||||
$path = $path / 1024;
|
||||
++$i;
|
||||
}
|
||||
|
||||
return round($path, $precision) . ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'][$i];
|
||||
}
|
||||
|
||||
return app('file')->humanReadableSize($path, $precision);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user