question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Progress formatting options for `PercentageColumn`

See original GitHub issue

Is your feature request related to a problem? Please describe.

I want to show a progress table using spectre. It works really well as it is, however, some operations take a really long time to complete, so I would like to be able to show more detailed progress values (e.g. 50.41% instead of just 50%).

The code responsible for this seems to be here:

https://github.com/spectreconsole/spectre.console/blob/813a53cdfaf24fb0ad759cc7af74d10b197c6618/src/Spectre.Console/Live/Progress/Columns/PercentageColumn.cs#L19-L24

And it doesn’t provide any outside entry points to customize this behavior.

Describe the solution you’d like

New ProgressColumn property of type string that serves as the format for task.Percentage.ToString(...). Potentially also a IFormattingProvider property too, but I personally need to use the current culture formatting anyway.

Describe alternatives you’ve considered

I could create my own ProgressColumn but I’d end up re-writing most of the stuff in the PercentageColumn.

Additional context

None that I could think of.

Issue Analytics

  • State:open
  • Created a month ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
patriksvenssoncommented, Aug 16, 2023

@Tyrrrz Format strings are hard 😄, and I want to keep the number of support issues down if I can. We could however (in addition) add a new column where you get a lambda with the task, and where you return a string of your choice. Perhaps that would be a middle road?

1reaction
patriksvenssoncommented, Aug 16, 2023

So, I’ve been thinking, and perhaps we can add a setting to the column whether it should round it to nearest integer or not, and with how many decimals.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Create Progress Bars in Excel (Step-by-Step)
Next, highlight the cell range B2:B11 that contains the progress percentages, then click the Conditional Formatting icon on the Home tab, then ...
Read more >
Progress Bar in Excel Cells Using Conditional Formatting
Step 1: Select Progress Data and Go to Conditional Formatting Option ... And another column is showing the percentage completed of the task....
Read more >
How to visualize percentage progress in Excel
In this guide, we're going to show you How to visualize percentage progress in Excel with Conditional Formatting.
Read more >
Excel Data Bars Conditional Formatting with examples
To fine-tune the appearance and settings your data bars, select any of the formatted cells, click Conditional Formatting > Manage Rule > Edit, ......
Read more >
How to Create Percentage Progress Bar in Google Sheets
A percentage progress bar is a bar in a single cell that changes according to the ... To apply the above highlighting, go...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found