提交 288f7bc6 作者: Thomas Gardner 提交者: David Dias

Humanize byte size

License: MIT
Signed-off-by: 's avatarThomas Gardner <tmg@fastmail.com>
上级 f988a54c
......@@ -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
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论