Skip to content

Progressbar cannot be initialized to 0 #13

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
erikkallen opened this issue Sep 4, 2017 · 1 comment · Fixed by #14
Closed

Progressbar cannot be initialized to 0 #13

erikkallen opened this issue Sep 4, 2017 · 1 comment · Fixed by #14
Labels

Comments

@erikkallen
Copy link
Contributor

If the progressbar is initialized with a value of 0 it will instead be 100%

bar.start(1,0.0) // -> results in 100% progress

The problem is this line of code

https://github.com/AndiDittrich/Node.CLI-Progress/blob/master/lib/Bar.js#L75

I will try to make a pull request if I have time if someone needs a workaround for the time beeing use a near 0 value as initial value

bar.start(1,0.00001)

@erikkallen erikkallen changed the title Progressbar will cannot be initialized to 0 Progressbar cannot be initialized to 0 Sep 4, 2017
erikkallen added a commit to erikkallen/Node.CLI-Progress that referenced this issue Sep 4, 2017
fixes npkgz#13 check for NaN explicitly and allow 0 as starting value
@mmcintyre123
Copy link

I also have this problem. Thank you for fixing this!

AndiDittrich pushed a commit that referenced this issue Sep 5, 2017
fixes #13 check for NaN explicitly
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants