spectre.console
spectre.console copied to clipboard
ProgressTask the calculation of GetPercantage can not handle division by 0
In my project the maxValue has 0 and the value is 0. The percentage calculation is then a division by 0 and the result percentage should be 0 too but it's -2,147,483,647
private double GetPercentage() { var percentage = (Value / MaxValue) * 100; percentage = Math.Min(100, Math.Max(0, percentage)); return percentage; }
Please upvote :+1: this issue if you are interested in it.
I can work on fixing this
Pull request is open here: https://github.com/spectreconsole/spectre.console/pull/991