accounting: fix total ETA when --stats-unit bits is in effect

This commit is contained in:
Nick Craig-Wood 2019-02-13 19:06:20 +00:00
parent 38864adc9c
commit 240c15883f

View file

@ -201,8 +201,9 @@ func (s *StatsInfo) String() string {
} }
dtRounded := dt - (dt % (time.Second / 10)) dtRounded := dt - (dt % (time.Second / 10))
displaySpeed := speed
if fs.Config.DataRateUnit == "bits" { if fs.Config.DataRateUnit == "bits" {
speed = speed * 8 displaySpeed *= 8
} }
var ( var (
@ -235,7 +236,7 @@ func (s *StatsInfo) String() string {
fs.SizeSuffix(s.bytes), fs.SizeSuffix(s.bytes),
fs.SizeSuffix(totalSize).Unit("Bytes"), fs.SizeSuffix(totalSize).Unit("Bytes"),
percent(s.bytes, totalSize), percent(s.bytes, totalSize),
fs.SizeSuffix(speed).Unit(strings.Title(fs.Config.DataRateUnit)+"/s"), fs.SizeSuffix(displaySpeed).Unit(strings.Title(fs.Config.DataRateUnit)+"/s"),
etaString(currentSize, totalSize, speed), etaString(currentSize, totalSize, speed),
xfrchkString, xfrchkString,
) )