X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=blobdiff_plain;f=src%2FPVE%2FFormat.pm;fp=src%2FPVE%2FFormat.pm;h=366bc161a0514a5139356c6e0839c3b6c7a7efd5;hp=ed860291d7df7704cde86ec81eb156fe5c3c7f57;hb=3bb8802a08b2bd57f82f00d7224ec6890986390b;hpb=ef737f0b3c0a79fb236539da0307929598d1340a diff --git a/src/PVE/Format.pm b/src/PVE/Format.pm index ed86029..366bc16 100644 --- a/src/PVE/Format.pm +++ b/src/PVE/Format.pm @@ -64,6 +64,8 @@ sub render_fraction_as_percentage { sub render_bytes { my ($value, $precision) = @_; + $precision = $precision->{precision} if ref($precision) eq 'HASH'; + my @units = qw(B KiB MiB GiB TiB PiB); my $max_unit = 0;