Skip to content

Commit

Permalink
✨ Add math ceil for loading percent
Browse files Browse the repository at this point in the history
  • Loading branch information
Androz2091 committed Mar 3, 2021
1 parent c1ec639 commit 994eb7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/extractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const readAnalyticsFile = (file) => {
let bytesRead = 0;
file.ondata = (_err, data, final) => {
bytesRead += data.length;
loadTask.set(`Loading user statistics... ${parseInt(bytesRead / file.originalSize * 100)}%`);
loadTask.set(`Loading user statistics... ${Math.ceil(bytesRead / file.originalSize * 100)}%`);
const remainingBytes = file.originalSize-bytesRead;
const timeToReadByte = (Date.now()-startAt) / bytesRead;
const remainingTime = parseInt(remainingBytes * timeToReadByte / 1000);
Expand Down

0 comments on commit 994eb7a

Please sign in to comment.