Adding method to specify floating-point precision#552
Adding method to specify floating-point precision#552cloppingemu wants to merge 3 commits intoconsole-rs:mainfrom
Conversation
|
I'm actually no longer sure I'm interested in adding a feature for this. This breaks compatibility, uses an unintuitive marker character ( Is there something we can do to make using a custom |
|
Fair enough. Issue with the marker was unavoidable because of the exisiting use of the more obvious choice. Open to suggestions for choice of character if we decide to merge in some version of the proposed changes. I'm also surprised it is breaking compatibility. I'll have to have have a look at the CI actions. I'll have a look at ProgressTracker and if it is easy and self-contained enough we could MAYBE just add an example for it instead. |
|
It's breaking because you added a field to I really don't want to add any more examples -- there are too many already. However, better documentation for |
|
Would agree with
Just going through the style.rs now to see how |
The existing `{percent}` is rendered as an integer, which means it is not very useful for large data sets, as it rarely changes.
I suggest adding a new `{percent_precise}` (a non-breaking change?) that would render it with additional precision. For example, 3 fraction digits, as demonstrated by the test added here.
An earlier proposal to add precision to variables was rejected (#552), and AFAIK, there is no way to customize this without taking over rendering.
I think it would work well with existing variables like `elapsed_precise`, `eta_precise`.
Thanks for considering!
Addresses #485
Precision can now be specified for percent, per_sec, elapsed_precise and eta_precise. Default precision values for percent, per_sec, elapsed_precise and eta_precise are 0, 4 (previous default), 0 and 0 respectively.
Precision can specified by the
-separator aspercent:-1orper_sec:-2.