From 73a648fb3203796a7ac1a8b6435ac430a4d3aeab Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Thu, 19 May 2016 17:15:10 +1000 Subject: [PATCH] Torrent.writeStatus: Include human readable torrent size --- client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index ceea2af8..dbebd1ba 100644 --- a/client.go +++ b/client.go @@ -23,6 +23,7 @@ import ( "github.com/anacrolix/missinggo/pubsub" "github.com/anacrolix/sync" "github.com/anacrolix/utp" + "github.com/dustin/go-humanize" "github.com/anacrolix/torrent/bencode" "github.com/anacrolix/torrent/dht" @@ -174,7 +175,7 @@ func (cl *Client) WriteStatus(_w io.Writer) { } fmt.Fprint(w, "\n") if t.haveInfo() { - fmt.Fprintf(w, "%f%% of %d bytes", 100*(1-float64(t.bytesLeft())/float64(t.length)), t.length) + fmt.Fprintf(w, "%f%% of %d bytes (%s)", 100*(1-float64(t.bytesLeft())/float64(t.length)), t.length, humanize.Bytes(uint64(t.length))) } else { w.WriteString("") } -- 2.48.1