]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Change Suffix (e.g., "G" -> " GB")
authorW. Felix Handte <w@felixhandte.com>
Wed, 9 Jun 2021 19:26:16 +0000 (15:26 -0400)
committerW. Felix Handte <w@felixhandte.com>
Thu, 10 Jun 2021 16:53:07 +0000 (12:53 -0400)
programs/fileio.c
programs/util.c

index c83c4fffd8484584ae16bfe02b76b14fd41d9c28..d149c5a64425aed00eb2dcd9fb3a774d21dab373 100644 (file)
@@ -1898,7 +1898,7 @@ int FIO_compressMultipleFilenames(FIO_ctx_t* const fCtx,
         UTIL_HumanReadableSize_t hr_osize = UTIL_makeHumanReadableSize((U64) fCtx->totalBytesOutput);
 
         DISPLAYLEVEL(2, "\r%79s\r", "");
-        DISPLAYLEVEL(2, "%3d files compressed : %.2f%%   (%.*f%s => %.*f%s bytes)\n",
+        DISPLAYLEVEL(2, "%3d files compressed : %.2f%%   (%.*f%s => %.*f%s)\n",
                         fCtx->nbFilesProcessed,
                         (double)fCtx->totalBytesOutput/((double)fCtx->totalBytesInput)*100,
                         hr_isize.precision, hr_isize.value, hr_isize.suffix,
index c8f6d1886a150a6d2160d5e67e1b03b3433a829b..838da830406691215a7d9039fb16f36ee5896076 100644 (file)
@@ -311,38 +311,38 @@ UTIL_HumanReadableSize_t UTIL_makeHumanReadableSize(U64 size) {
          * values that exceed the integral precision of a double. */
         if (size >= (1ull << 53)) {
             hrs.value = (double)size / (1ull << 20);
-            hrs.suffix = "M";
+            hrs.suffix = " MB";
             /* At worst, a double representation of a maximal size will be
              * accurate to better than tens of kilobytes. */
             hrs.precision = 2;
         } else {
             hrs.value = (double)size;
-            hrs.suffix = "";
+            hrs.suffix = " B";
             hrs.precision = 0;
         }
     } else {
         /* In regular mode, scale sizes down and use suffixes. */
         if (size >= (1ull << 60)) {
             hrs.value = (double)size / (1ull << 60);
-            hrs.suffix = "E";
+            hrs.suffix = " EB";
         } else if (size >= (1ull << 50)) {
             hrs.value = (double)size / (1ull << 50);
-            hrs.suffix = "P";
+            hrs.suffix = " PB";
         } else if (size >= (1ull << 40)) {
             hrs.value = (double)size / (1ull << 40);
-            hrs.suffix = "T";
+            hrs.suffix = " TB";
         } else if (size >= (1ull << 30)) {
             hrs.value = (double)size / (1ull << 30);
-            hrs.suffix = "G";
+            hrs.suffix = " GB";
         } else if (size >= (1ull << 20)) {
             hrs.value = (double)size / (1ull << 20);
-            hrs.suffix = "M";
+            hrs.suffix = " MB";
         } else if (size >= (1ull << 10)) {
             hrs.value = (double)size / (1ull << 10);
-            hrs.suffix = "K";
+            hrs.suffix = " KB";
         } else {
             hrs.value = (double)size;
-            hrs.suffix = "";
+            hrs.suffix = " B";
         }
 
         if (hrs.value >= 100 || (U64)hrs.value == size) {