all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH container] fix #5414: use proper percentages in `pct df`
@ 2024-04-25  7:40 Fabian Grünbichler
  2024-04-25 16:17 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Grünbichler @ 2024-04-25  7:40 UTC (permalink / raw)
  To: pve-devel

while some people write percentages as 0.XX , putting a % next to that is just
confusing. also, combined with the format modifier this would be rather lossy,
and also not match regular `df` output..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
---
 src/PVE/CLI/pct.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/CLI/pct.pm b/src/PVE/CLI/pct.pm
index c48321d..4504b54 100755
--- a/src/PVE/CLI/pct.pm
+++ b/src/PVE/CLI/pct.pm
@@ -433,7 +433,7 @@ __PACKAGE__->register_method({
 		    my $used = $format->($df->{used});
 		    my $avail = $format->($df->{avail});
 
-		    my $pc = sprintf('%.1f', $df->{used}/$df->{total});
+		    my $pc = sprintf('%.1f', 100 * $df->{used} / $df->{total});
 
 		    my $entry = [ $name, $mp->{volume}, $total, $used, $avail, $pc, $path ];
 		    push @list, $entry;
-- 
2.39.2



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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] applied: [PATCH container] fix #5414: use proper percentages in `pct df`
  2024-04-25  7:40 [pve-devel] [PATCH container] fix #5414: use proper percentages in `pct df` Fabian Grünbichler
@ 2024-04-25 16:17 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2024-04-25 16:17 UTC (permalink / raw)
  To: Proxmox VE development discussion, Fabian Grünbichler

Am 25/04/2024 um 09:40 schrieb Fabian Grünbichler:
> while some people write percentages as 0.XX , putting a % next to that is just
> confusing. also, combined with the format modifier this would be rather lossy,
> and also not match regular `df` output..
> 

Fixes: c6b5965 ("added 'pct df'")

(but I now forgot to amend it too...)

> Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
> ---
>  src/PVE/CLI/pct.pm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
>

applied, thanks!


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-25 16:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-25  7:40 [pve-devel] [PATCH container] fix #5414: use proper percentages in `pct df` Fabian Grünbichler
2024-04-25 16:17 ` [pve-devel] applied: " Thomas Lamprecht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal