From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 12/19] general-functions.pl: formatBytes() Fix computing the correct unit. Date: Mon, 13 Apr 2020 09:45:43 +0200 Message-ID: <20200413074550.2735-12-stefan.schantl@ipfire.org> In-Reply-To: <20200413074550.2735-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7059577608721804175==" List-Id: --===============7059577608721804175== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Signed-off-by: Stefan Schantl --- config/cfgroot/general-functions.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-fun= ctions.pl index 692e072c2..4c7cf09a8 100644 --- a/config/cfgroot/general-functions.pl +++ b/config/cfgroot/general-functions.pl @@ -1272,14 +1272,14 @@ sub formatBytes { =20 # Loop through the array of units. foreach my $element (@units) { + # Assign current processed element to unit. + $unit =3D $element; + # Break loop if the bytes are less than the next unit. last if $bytes < 1024; =20 # Divide bytes amount with 1024. $bytes /=3D 1024; - - # Assign current processed element to unit. - $unit =3D $element; } =20 # Return the divided and rounded bytes count and the unit. --=20 2.26.0 --===============7059577608721804175==--