public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Stoiko Ivanov <s.ivanov@proxmox.com>
Subject: [pve-devel] applied: [PATCH installer] get_device_desc: display disk size with 2 decimal places
Date: Wed, 26 Jan 2022 12:03:22 +0100	[thread overview]
Message-ID: <0049a5d0-55a9-2677-d251-0e37df3c56fc@proxmox.com> (raw)
In-Reply-To: <20220125130443.1163977-1-s.ivanov@proxmox.com>

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.ivanov@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!




      reply	other threads:[~2022-01-26 11:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-25 13:04 [pve-devel] " Stoiko Ivanov
2022-01-26 11:03 ` Thomas Lamprecht [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0049a5d0-55a9-2677-d251-0e37df3c56fc@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=s.ivanov@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal