roelvandijk / terminal-progress-bar

Other
24 stars 9 forks source link

progressBar doesn't check for 0 input #17

Closed wenkokke closed 7 years ago

wenkokke commented 7 years ago

The library doesn't check for 0 input for the "amount of work done", meaning that if you call any of the progressBar functions with 0 as the 4th argument:

progressBar prefLbl postLbl windowHeight workDone workTotal

You get a nice prefLbl [exe: Ratio has zero denominator error.

roelvandijk commented 7 years ago

That should definitely be fixed. Thanks for the report!

roelvandijk commented 7 years ago

The problem was in the percentage label function. It is now fixed and a regression test was added. Thanks again!