Humanize byte size
License: MIT Signed-off-by: Thomas Gardner <tmg@fastmail.com>
Thomas Gardner committed
Feb 10, 2016 at 20:07 UTC
288f7bc62143734452a47262dee5c8ce714bf551
1 file changed
+3
-2
core/commands/repo.go
+3
-2
@@ -6,6 +6,7 @@ import (
6
"io"
7
"strings"
8
9
+ humanize "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/dustin/go-humanize"
10
cmds "github.com/ipfs/go-ipfs/commands"
11
corerepo "github.com/ipfs/go-ipfs/core/corerepo"
12
fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo"
@@ -156,8 +157,8 @@ var repoStatCmd = &cmds.Command{
157
}
158
159
out := fmt.Sprintf(
159
- "Path: %s\nSize: %d bytes\nBlocks: %d\n",
160
- stat.repoPath, stat.repoSize, stat.numBlocks)
160
+ "Path: %s\nSize: %s\nBlocks: %d\n",
161
+ stat.repoPath, humanize.Bytes(stat.repoSize), stat.numBlocks)
162
163
return strings.NewReader(out), nil
164
},