Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Invalid percantage on progress 999/1000 => 100% #70

Closed
OxCom opened this issue Apr 29, 2020 · 1 comment
Closed

Invalid percantage on progress 999/1000 => 100% #70

OxCom opened this issue Apr 29, 2020 · 1 comment
Labels
bug validated issue validated by maintainer

Comments

@OxCom
Copy link

OxCom commented Apr 29, 2020

Example:

import cliProgress from 'cli-progress';

const cli = new cliProgress.SingleBar();

cli.start(1000);
cli.update(999);

Output:
progress [========================================] 100% | ETA: 1s | 999/1000

Current progress: 100%
Expected: 99%

@AndiDittrich AndiDittrich added bug validated issue validated by maintainer labels Apr 29, 2020
@AndiDittrich
Copy link
Member

Hi @OxCom ,

thanks for your feddback.

currently standard Math.round is applied to calculate the percentage value. it should be replaced by Math.floor to round down to the nearest integer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug validated issue validated by maintainer
Projects
None yet
Development

No branches or pull requests

2 participants