Hi, my be it's better to use something like this:
if (($value >= $tebibytes) ) {
if (($value % $tebibytes) === 0)
return ($value / $tebibytes) . 'T';
else
return (int)($value / $gibibytes) . 'G';
}
if (($value >= $gibibytes) ) {
if (($value % $gibibytes) === 0)
return ($value / $gibibytes) . 'G';
else
return (int)($value / $mebibytes) . 'M';
}
if (($value >= $mebibytes) ) {
if (($value % $mebibytes) === 0)
return ($value / $mebibytes) . 'M';
else
return $value;
}
--
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 Thu, 2020-06-11 at 23:46 +0200, Juergen Holm wrote:
> Hi,
>
> problematic function is addBlockUnits($value) in quota.inc
>
> value= 1023 return 1023
> value= 1024 return 1M
> value= 1025 return ""
>
> I think addBlockUnits should modified to
>
> if (($value >= $tebibytes) ) {
> return (sprintf("%.3fT", $value / $tebibytes));
> }
> if (($value >= $gibibytes) ) {
> return (sprintf("%.3fG", $value / $gibibytes));
> }
> if (($value >= $mebibytes) ) {
> return (sprintf("%.3fM", $value / $mebibytes));
> }
>
> This may have other effects when reading the formular!?
>
>
> On Thu, 2020-06-11 at 21:52 +0200, Juergen Holm wrote:
> > Hi Roland,
> >
> > this was my first thought too. But LAM is running on 3.10.0-
> > 1127.10.1.el7.x86_64 with httpd24-1.1-19.el7.x86_64 and rh-php73-1-
> > 1.el7.x86_64.
> >
> > Another test:
> > QUOTA_ENTRY
> > /export/home0,305075812,500000000,600000000,0,305159,0,0,0:
> > No soft and hard limits are displayed
> >
> > QUOTA_ENTRY /export/home0,4184,524288000,734003200,0,190,0,0,0:
> > All Ok.
> > 524288000 = 500G
> > 734003200 = 700G
> >
> > I guess there is something wrong with the conversion to the Units
> > G,
> > T..
> >
>
> _______________________________________________
> Lam-public mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/lam-public
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Lam-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/lam-public
