Subject: [PATCH v2 1/2] guix gc: Round MiBs in user feedback.

From: Remco van 't Veer <[email-masked]>
Date: Mon, 23 Jan 2023 14:01:25 +0100

* guix/scripts/gc.scm (guix-gc): Round MiBs in user feedback.
---
 guix/scripts/gc.scm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/guix/scripts/gc.scm b/guix/scripts/gc.scm
index 5e775c5cdb..2bbfb26d5d 100644
--- a/guix/scripts/gc.scm
+++ b/guix/scripts/gc.scm
@@ -260,10 +260,10 @@ (define-command (guix-gc . args)
     ;; Attempt to have at least SPACE bytes available in STORE.
     (let ((free (free-disk-space (%store-prefix))))
       (if (> free space)
-          (info (G_ "already ~h MiBs available on ~a, nothing to do~%")
+          (info (G_ "already ~,2h MiBs available on ~a, nothing to do~%")
                 (/ free 1024. 1024.) (%store-prefix))
           (let ((to-free (- space free)))
-            (info (G_ "freeing ~h MiBs~%") (/ to-free 1024. 1024.))
+            (info (G_ "freeing ~,2h MiBs~%") (/ to-free 1024. 1024.))
             (collect-garbage store to-free)))))
 
   (define (delete-generations store pattern)
@@ -327,10 +327,10 @@ (define-command (guix-gc . args)
              (ensure-free-space store free-space))
             (min-freed
              (let-values (((paths freed) (collect-garbage store min-freed)))
-              (info (G_ "freed ~h MiBs~%") (/ freed 1024. 1024.))))
+              (info (G_ "freed ~,2h MiBs~%") (/ freed 1024. 1024.))))
             (else
              (let-values (((paths freed) (collect-garbage store)))
-              (info (G_ "freed ~h MiBs~%") (/ freed 1024. 1024.)))))))
+              (info (G_ "freed ~,2h MiBs~%") (/ freed 1024. 1024.)))))))
         ((list-roots)
          (assert-no-extra-arguments)
          (list-roots))
-- 
2.39.1