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

[feature request] adding {percent_precise} style key #628

Merged
merged 1 commit into from
Feb 8, 2024
Merged

[feature request] adding {percent_precise} style key #628

merged 1 commit into from
Feb 8, 2024

Conversation

OmarTawfik
Copy link
Contributor

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 this proposal would work well with existing variables like elapsed_precise, eta_precise.

Thanks for considering!

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!
Copy link
Member

@djc djc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems okay. @chris-laplante what do you think?

(Note that this can be done using a custom ProgressTracker implementation.)

@chris-laplante
Copy link
Collaborator

Seems okay. @chris-laplante what do you think?

(Note that this can be done using a custom ProgressTracker implementation.)

I think it's a common enough use case that we shouldn't force people to use ProgressTracker. So +1 from me.

@djc djc merged commit f8d33f9 into console-rs:main Feb 8, 2024
10 checks passed
@OmarTawfik OmarTawfik deleted the precision-precise branch February 8, 2024 16:29
@OmarTawfik
Copy link
Contributor Author

@djc @chris-laplante
Thanks for looking into this! I wonder when do new released get pushed to crates.io?

@djc
Copy link
Member

djc commented Feb 9, 2024

More or less by request: #629.

@OmarTawfik
Copy link
Contributor Author

OmarTawfik commented Feb 9, 2024

@djc looks like the deployment failed (job) 😞
One test (style::tests::wide_element_style) randomly failed. Not sure why, although it succeeded in other jobs in the matrix, and with the same toolchain on the previous commit. I don't have permissions to rerun the job, but please let me know if I can debug/help with anything otherwise to unblock publishing.

@chris-laplante
Copy link
Collaborator

@djc looks like the deployment failed (job) 😞 One test (style::tests::wide_element_style) randomly failed. Not sure why, although it succeeded in other jobs in the matrix, and with the same toolchain on the previous commit. I don't have permissions to rerun the job, but please let me know if I can debug/help with anything otherwise to unblock publishing.

It is unrelated to your changes - it failed a few days ago as well: #631

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

Successfully merging this pull request may close these issues.

3 participants