mirror of
https://github.com/unraid/webgui.git
synced 2026-01-09 19:20:06 -06:00
Share/Pool size calculation: show and allow percentage values
This commit is contained in:
@@ -43,9 +43,9 @@ function presetSpace($val) {
|
||||
$units = ['KB','MB','GB','TB','PB','EB','ZB','YB'];
|
||||
$base = $val>0 ? floor(log($val,1000)) : 0;
|
||||
$size = round($val/pow(1000,$base),1);
|
||||
return number_format($size,$size-floor($size)==0?0:1,$dot,$comma).' '._var($units,$base);
|
||||
return number_format($size,$size-floor($size)?1:0,$dot,$comma).' '._var($units,$base);
|
||||
} else {
|
||||
return $size>0 ? number_format($size,$size-floor($size)==0?0:1,$dot,$comma).' %' : '';
|
||||
return $size>0 ? number_format($size,$size-floor($size)?1:0,$dot,$comma).' %' : '';
|
||||
}
|
||||
}
|
||||
function fsSize() {
|
||||
|
||||
@@ -71,9 +71,9 @@ function presetSpace($val) {
|
||||
$units = ['KB','MB','GB','TB','PB','EB','ZB','YB'];
|
||||
$base = $val>0 ? floor(log($val,1000)) : 0;
|
||||
$size = round($val/pow(1000,$base),1);
|
||||
return number_format($size,$size-floor($size)==0?0:1,$dot,$comma).' '._var($units,$base);
|
||||
return number_format($size,$size-floor($size)?1:0,$dot,$comma).' '._var($units,$base);
|
||||
} else {
|
||||
return $size>0 ? number_format($size,$size-floor($size)==0?0:1,$dot,$comma).' %' : '';
|
||||
return $size>0 ? number_format($size,$size-floor($size)?1:0,$dot,$comma).' %' : '';
|
||||
}
|
||||
}
|
||||
function fsSize() {
|
||||
|
||||
Reference in New Issue
Block a user