Merge pull request #501 from abperiasamy/ls-humanize-size

Humanize ls size field
This commit is contained in:
Anand Babu (AB) Periasamy
2015-04-23 01:48:19 -07:00
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -33,7 +33,7 @@ func Comma(v int64) string {
j--
}
parts[j] = strconv.Itoa(int(v))
return sign + strings.Join(parts[j:], ",")
return sign + strings.Join(parts[j:len(parts)], ",")
}
// Commaf produces a string form of the given number in base 10 with
@@ -97,5 +97,5 @@ func BigComma(b *big.Int) string {
j--
}
parts[j] = strconv.Itoa(int(b.Int64()))
return sign + strings.Join(parts[j:], ",")
return sign + strings.Join(parts[j:len(parts)], ",")
}
+3 -3
View File
@@ -21,7 +21,7 @@ import (
"fmt"
"github.com/cheggaaa/pb"
"github.com/dustin/go-humanize"
"github.com/minio-io/cli"
"github.com/minio-io/mc/pkg/client"
"github.com/minio-io/mc/pkg/console"
@@ -45,8 +45,8 @@ func printItems(v []*client.Item) {
// printItem prints item meta-data
func printItem(date time.Time, v int64, name string) {
fmt.Printf(console.Time("%s ", date.Local().Format(printDate)))
fmt.Printf(console.Size("[%9s] ", pb.FormatBytes(v)))
fmt.Printf(console.Time("[%s] ", date.Local().Format(printDate)))
fmt.Printf(console.Size("%5s ", humanize.Bytes(uint64(v))))
fmt.Println(console.File("%s", name))
}