Hi Roland, I also prefer numbers dividable by 1024 for hard/soft limits. But the chance that current block usage is dividable by 1024 is nearly 0.
So, the main reason for my proposal is a readable block usage number. $singleQuota[1] = $this->addBlockUnits($singleQuota[1]); -- Mit freundlichen Grüßen ##------------ IT Physik / Georg August Universitaet Goettingen --------- ## Tel:+49 551 3929363 http://www.theorie.physik.uni-goettingen.de/jh.html ## ## Rechtschreibfehler sind Absicht und dienen der allgemeinen Belustigung. ##-------------- Verschtehen Sie, Isch habe garrr kein Wooerd! ----------- On Sat, 2020-06-13 at 20:46 +0200, Roland Gruber wrote: > Hi Jürgen, > > but 10T+1 is 10T+1 and not just 10T. Changing the numbers that way > would lead to changes of the quota even if the value in dialog is not > changed. > > I recommend to use numbers that are dividable by 1024 for blocks. > Then there is no issue with the display. > > Is there any specific reason to use odd numbers? > > Best regards > Roland > > Am 13. Juni 2020 13:46:59 MESZ schrieb Juergen Holm < > [email protected]>: > > Dear Roland, > > > > sorry, but your solutions did not lead to readable numbers. I think > > numbers should be displayed always with unit T,G,M. > > Example: > > 10T-1 should be displayed as 10239M and not as 10737418239 > > 10T+1 should be displayed as 10T and not as 10737418241 > > > > I propose: > > 1. in function initQuotas() > > add > > $singleQuota[1] = $this->addBlockUnits($singleQuota[1]); > > > > 2. change function addBlockUnits() > > to > > if (empty($value) || !get_preg($value, 'digit')) { > > return $value; > > } > > if (($value >= 10*$tebibytes) || (($value % $tebibytes) === > > 0) ) > > return ((int)($value / $tebibytes)) . 'T'; > > else if (($value >= $tebibytes)) > > return ((int)($value / $gibibytes)) . 'G'; > > > > else if (($value >= 10* $gibibytes) || (($value % > > $gibibytes) === 0)) > > return ((int)($value / $gibibytes)) . 'G'; > > else if (($value >= $gibibytes)) > > return ((int)($value / $mebibytes)) . 'M'; > > > > else if(($value >= 10* $mebibytes) || (($value % > > $mebibytes) === 0)) > > return ( (int)($value / $mebibytes)) . 'M'; > > else > > return $value; > > > > 3. analog inodes
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Lam-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/lam-public
