On 25.01.22 14:04, Stoiko Ivanov wrote:
> instead of cutting it off by using int
> 
> especially relevant currently with 2 TB disks (people wonder why
> it's displayed as 1 TiB - and would be fine with 1.95TiB).
> 
> Reported in our community forum:
> https://forum.proxmox.com/threads/.103636/
> 
> Tested in a VM with a 100 GiB, 20GiB and 2TiB disk
> 
> Addtionally added the explicit return ath the end of the if branch,
> instead of relying on the last statement not moving.
> 
> Signed-off-by: Stoiko Ivanov <s.iva...@proxmox.com>
> ---
> Alternatively we could also use sprintf without decimal places for rounding
> (Math::Round is a debian package of it's own) - if people consider
> 20.00GiB to not look too pleasing

In general I really do not find that too pleasing, but here I think that first,
knowing the cheapness of HW vendors and TB vs TiB exact sizes won't happen often
and second, keeping it simple in the installer has quite some merit, so your
solutions works fine for me here.

> 
> Thanks to Dominik for insisting to see the code on this and suggesting
> to actually improve it :)
> 
>  proxinstall | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
>

applied, thanks!


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to