goblinfactory / konsole

Home of the simple console library consisting of ProgressBar, Window, Form, Draw & MockConsole (C# console progress bar with support for single or multithreaded progress updates) Window is a 100%-ish console compatible window, supporting all normal console writing to a windowed section of the screen, supporting scrolling and clipping of console output.
721 stars 62 forks source link

Incorrect percentage display #26

Closed marecki90 closed 5 years ago

marecki90 commented 5 years ago

Hi, I found percentage display issue. When I create ProgressBarSlim with max as 100: var bar = new ProgressBarSlim(100, ProgressWindow); and I call 10 times: bar.Next("Test"); I can see the following numbers 0, 1, 2, 3, 5, 5, 7, 7, 9, 10.

I looked at the code and noticed that the problem is with casting floats that are not written to variables: image Convert.Int32(percentage * 100) also works if you don't want variables

goblinfactory commented 5 years ago

this has been fixed in release 3.4.0, nuget package is now available.