Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use Data Formatting feature? #668

Open
Timmmm opened this issue Nov 22, 2024 · 3 comments
Open

How to use Data Formatting feature? #668

Timmmm opened this issue Nov 22, 2024 · 3 comments

Comments

@Timmmm
Copy link

Timmmm commented Nov 22, 2024

There are no examples for how to use the Data Formatting structs. I assume something like this:

let bar = ProgressBar::new().with_format(HumanBytes);

But the only examples are for using HumanBytes directly.

@djc
Copy link
Member

djc commented Nov 22, 2024

Use them via the templates, like human_len etc?

https://docs.rs/indicatif/latest/indicatif/#templates

@Timmmm
Copy link
Author

Timmmm commented Nov 22, 2024

Is that the intention? If so I suggest adding a comment like

This is used by decimal_bytes and decimal_total_bytes in format templates.

to the DecimalBytes struct description (and similarly for the others).

@djc
Copy link
Member

djc commented Nov 25, 2024

Happy to review a PR for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants