vbauerster / mpb

multi progress bar for Go cli applications
The Unlicense
2.29k stars 123 forks source link

non-complete bar says 100% #64

Closed nektro closed 4 years ago

nektro commented 4 years ago
Task 47 : 1881 / 1885 [================================]  100 %:    00:06:

This is in reference to the 1881 / 1885 which is calculated with using decor.CountersNoUnit("%d / %d", decor.WCSyncWidth),

vbauerster commented 4 years ago

That is expected if you use Percentage decorator which defaults to zero precision. If you need non-zero percentage precision use NewPercentage instead.

https://play.golang.org/p/y1sDAIYDxl2

You may need to initialize percentage like this.

nektro commented 4 years ago

This works, thanks so much for the pointer. :heart: