client.go | 3 ++- diff --git a/client.go b/client.go index ceea2af8473dbdd51d472741d88d3cbc4b54aeff..dbebd1ba4e59616bb6ca4e951cc411f3f6a96e33 100644 --- a/client.go +++ b/client.go @@ -23,6 +23,7 @@ "github.com/anacrolix/missinggo/pproffd" "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 @@ fmt.Fprint(w, t.name()) } 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("") }