From ccc2bd7b88c0a08020a99aaec8da74d6f367b331 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fabian=20Gr=C3=BCnbichler?= Date: Thu, 25 Apr 2024 09:40:13 +0200 Subject: [PATCH] fix #5414: use proper percentages in `pct df` MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- 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