RED-6537: Fixed download size conversion.

This commit is contained in:
Nicoleta Panaghiu 2023-04-04 19:39:05 +03:00
parent 1fb671e8c2
commit 634a1aa8de

View File

@ -45,7 +45,7 @@ export class DownloadStatus implements IDownloadStatus, IListable {
}
private get _size() {
const i = this.fileSize === 0 ? 0 : Math.floor(Math.log(this.fileSize) / Math.log(1024));
return (this.fileSize / Math.pow(1024, i)).toFixed(2) + ' ' + ['B', 'kB', 'MB', 'GB', 'TB'][i];
const i = this.fileSize === 0 ? 0 : Math.floor(Math.log(this.fileSize) / Math.log(1000));
return (this.fileSize / Math.pow(1000, i)).toFixed(2) + ' ' + ['B', 'kB', 'MB', 'GB', 'TB'][i];
}
}