From 4672ce0b537fda6b28e765ed040bb3a865219b77 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 21 Jan 2019 11:48:02 +0100 Subject: packages/pkginfo.php: print human-readable units --- packages/pkginfo.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/pkginfo.php b/packages/pkginfo.php index d495cf0..0717aa1 100644 --- a/packages/pkginfo.php +++ b/packages/pkginfo.php @@ -333,6 +333,11 @@ require_once BASE . "/lib/style.php"; else $content = array_merge($mysql_content,$json_content); + foreach (array("Download Size", "Installed Size") as $key) { + $content["Print " . $key] = + add_fancy_unit($content[$key], "B"); + } + // query substitutes $mysql_result = mysql_run_query( @@ -574,7 +579,7 @@ if ($count > 1 || $content["pkgname"] != $content["pkgbase"]) { Package Size: - not found in pkg-api")."\n"; ?> + not found in pkg-api")."\n"; ?> @@ -582,7 +587,7 @@ if ($count > 1 || $content["pkgname"] != $content["pkgbase"]) { Installed Size: - not found in pkg-api")."\n"; ?> + not found in pkg-api")."\n"; ?> -- cgit v1.2.3-70-g09d2