mirror of
https://github.com/unraid/webgui.git
synced 2026-01-22 01:19:56 -06:00
Shares: show "Minimum free space" as absolute number instead of percentage
This commit is contained in:
@@ -62,13 +62,10 @@ function presetSpace($val) {
|
||||
$pool = _var($shares[$name],'cachePool');
|
||||
$size = _var($fsSize,$pool,0);
|
||||
$size = $size>0 ? round(100*$val/$size,1) : 0;
|
||||
$unit = '%';
|
||||
if ($size < 1) {
|
||||
$units = ['KB','MB','GB','TB','PB','EB','ZB','YB'];
|
||||
$base = $val>0 ? floor(log($val,1000)) : 0;
|
||||
$size = round($val/pow(1000,$base),1);
|
||||
$unit = _var($units,$base);
|
||||
}
|
||||
$units = ['KB','MB','GB','TB','PB','EB','ZB','YB'];
|
||||
$base = $val>0 ? floor(log($val,1000)) : 0;
|
||||
$size = round($val/pow(1000,$base),1);
|
||||
$unit = _var($units,$base);
|
||||
[$dot,$comma] = str_split(_var($display,'number','.,'));
|
||||
return $size>0 ? number_format($size,$size-floor($size)?1:0,$dot,$comma).' '.$unit : '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user