From 812eca3aa55b1179c7b08a012d5efb64561338f0 Mon Sep 17 00:00:00 2001 From: Jguer Date: Fri, 23 Jun 2017 09:43:57 +0100 Subject: [PATCH] Fixes #29. Changed to MiB and KiB and added simple float --- pacman/pacman.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pacman/pacman.go b/pacman/pacman.go index 865b7a32..b60502cd 100644 --- a/pacman/pacman.go +++ b/pacman/pacman.go @@ -306,7 +306,7 @@ func BiggestPackages() { } for i := 0; i < 10; i++ { - fmt.Printf("%s: \x1B[0;33m%dMB\x1B[0m\n", pkgS[i].Name(), pkgS[i].ISize()/(1024*1024)) + fmt.Printf("%s: \x1B[0;33m%.1fMiB\x1B[0m\n", pkgS[i].Name(), float32(pkgS[i].ISize())/(1024.0*1024.0)) } // Could implement size here as well, but we just want the general idea } @@ -326,7 +326,8 @@ func HangingPackages() (hanging []string, err error) { requiredby := pkg.ComputeRequiredBy() if len(requiredby) == 0 { hanging = append(hanging, pkg.Name()) - fmt.Printf("%s: \x1B[0;33m%dMB\x1B[0m\n", pkg.Name(), pkg.ISize()/(1024*1024)) + fmt.Println(pkg.ISize()) + fmt.Printf("%s: \x1B[0;33m%.2f KiB\x1B[0m\n", pkg.Name(), float32(pkg.ISize())/(1024.0)) } return nil