forked from TrueCloudLab/rclone
Make SizeSuffix output without b
suffix for more useful printouts
This commit is contained in:
parent
9bbcdeefd0
commit
772f99fd74
2 changed files with 2 additions and 2 deletions
|
@ -108,7 +108,7 @@ func (x SizeSuffix) String() string {
|
||||||
return "0"
|
return "0"
|
||||||
case x < 1024:
|
case x < 1024:
|
||||||
scaled = float64(x)
|
scaled = float64(x)
|
||||||
suffix = "b"
|
suffix = ""
|
||||||
case x < 1024*1024:
|
case x < 1024*1024:
|
||||||
scaled = float64(x) / 1024
|
scaled = float64(x) / 1024
|
||||||
suffix = "k"
|
suffix = "k"
|
||||||
|
|
|
@ -12,7 +12,7 @@ func TestSizeSuffixString(t *testing.T) {
|
||||||
want string
|
want string
|
||||||
}{
|
}{
|
||||||
{0, "0"},
|
{0, "0"},
|
||||||
{102, "102b"},
|
{102, "102"},
|
||||||
{1024, "1k"},
|
{1024, "1k"},
|
||||||
{1024 * 1024, "1M"},
|
{1024 * 1024, "1M"},
|
||||||
{1024 * 1024 * 1024, "1G"},
|
{1024 * 1024 * 1024, "1G"},
|
||||||
|
|
Loading…
Reference in a new issue