From 634a1aa8ded487f3fe5d2b3ef8ad8931804ba9f8 Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Tue, 4 Apr 2023 19:39:05 +0300 Subject: [PATCH] RED-6537: Fixed download size conversion. --- libs/red-domain/src/lib/downloads/download-status.model.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/red-domain/src/lib/downloads/download-status.model.ts b/libs/red-domain/src/lib/downloads/download-status.model.ts index fabdb5fa4..4b61210a8 100644 --- a/libs/red-domain/src/lib/downloads/download-status.model.ts +++ b/libs/red-domain/src/lib/downloads/download-status.model.ts @@ -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]; } }