From 288f7bc62143734452a47262dee5c8ce714bf551 Mon Sep 17 00:00:00 2001 From: Thomas Gardner Date: Wed, 10 Feb 2016 20:07:31 +1000 Subject: [PATCH] Humanize byte size License: MIT Signed-off-by: Thomas Gardner --- core/commands/repo.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/commands/repo.go b/core/commands/repo.go index 445d3a9c6..7054ae982 100644 --- a/core/commands/repo.go +++ b/core/commands/repo.go @@ -6,6 +6,7 @@ import ( "io" "strings" + humanize "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/dustin/go-humanize" cmds "github.com/ipfs/go-ipfs/commands" corerepo "github.com/ipfs/go-ipfs/core/corerepo" fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo" @@ -156,8 +157,8 @@ var repoStatCmd = &cmds.Command{ } out := fmt.Sprintf( - "Path: %s\nSize: %d bytes\nBlocks: %d\n", - stat.repoPath, stat.repoSize, stat.numBlocks) + "Path: %s\nSize: %s\nBlocks: %d\n", + stat.repoPath, humanize.Bytes(stat.repoSize), stat.numBlocks) return strings.NewReader(out), nil },