console-rs / indicatif

A command line progress reporting library for Rust
MIT License
4.36k stars 241 forks source link

How do I make `percent` round down? #544

Closed ajeetdsouza closed 1 year ago

ajeetdsouza commented 1 year ago

I'd like to make the percent field show the floor of the actual value. The motivation for this is that I don't want the percentage to show as 100% till the last block is completed.

djc commented 1 year ago

I recommend implementing a custom ProgressTracker.

ajeetdsouza commented 1 year ago

That works, thanks! Some examples / better documentation of it would be nice, I did go through the documentation but I couldn't figure out what ProgressTracker was till I saw your comment.

djc commented 1 year ago

If you would be able to submit a PR with improved documentation and/or examples, that would be great!