You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a fantastic crate, thanks so much for building and maintaining it!
I'm currently including {pos}/{len} in my template string, but for huge data, something like "33857009/42672348" isn't terribly readable to me. I'd like to style it as "33,857,009/42,672,348". I'm proposing:
Adding a HumanCount structure along the lines of HumanBytes
Option 1) Just hardcode the use of US-style commas.
2) Use num_format and allow the user to explicitly override a Locale, possibly as a new set_locale method on ProgressBar
3) Use num_format and enable the with-system-locale feature
4) Use num_format, let people specify the locale in the string (like {len:en}), and have some kind of parsing to get to the Locale enum
Any preferences here? I'm happy to send a PR; the hard part is making these decisions. Thanks!
The text was updated successfully, but these errors were encountered:
This is a fantastic crate, thanks so much for building and maintaining it!
I'm currently including
{pos}/{len}
in my template string, but for huge data, something like "33857009/42672348" isn't terribly readable to me. I'd like to style it as "33,857,009/42,672,348". I'm proposing:HumanCount
structure along the lines ofHumanBytes
human_pos
andhuman_len
as template keys, in https://github.com/mitsuhiko/indicatif/blob/0626585b006e9ba11df065c0d0d3df275d202257/src/style.rs#L270Very open to better names than these. To actually do the formatting could be a bit tricky, since there are different styles based on locale: https://docs.microsoft.com/en-us/globalization/locale/number-formatting.
Option 1) Just hardcode the use of US-style commas.
2) Use num_format and allow the user to explicitly override a
Locale
, possibly as a newset_locale
method onProgressBar
3) Use
num_format
and enable thewith-system-locale
feature4) Use
num_format
, let people specify the locale in the string (like{len:en}
), and have some kind of parsing to get to theLocale
enumAny preferences here? I'm happy to send a PR; the hard part is making these decisions. Thanks!
The text was updated successfully, but these errors were encountered: