Skip to content

Commit

Permalink
Update progress.js (#384)
Browse files Browse the repository at this point in the history
Simplified progress percent calculation
  • Loading branch information
AnimationFlow authored Jan 7, 2021
1 parent a56eeb6 commit 8c9753a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ directorySize(directory, function(err, totalSize) {
});

archive.on('progress', function(progress) {
var percent = 100 - ((totalSize - progress.fs.processedBytes) / totalSize) * 100;
var percent = progress.fs.processedBytes / totalSize * 100;

console.log('%s / %s (%d %)', bytesToSize(progress.fs.processedBytes), prettyTotalSize, percent);
})
Expand Down

0 comments on commit 8c9753a

Please sign in to comment.