Skip to content

Commit

Permalink
wc: fix unit size for International System #TASK-5931
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodielm committed May 13, 2024
1 parent eb021df commit ac7af43
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/utils-new.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,9 @@ export default class UtilsNew {
const k = useInternationalSystem ? 1000 : 1024;
const dm = numDecimals ? numDecimals : 2;
const sizes = [" Bytes", " KB", " MB", " GB", " TB", " PB", " EB", " ZB", " YB"];
const sizesIS = [" Bytes", " KiB", " MiB", " GiB", " TiB", " PiB", " EiB", " ZiB", " YiB"];
const i = Math.floor(Math.log(bytes) / Math.log(k));
return (bytes / Math.pow(k, i)).toFixed(dm) + sizes[i];
return (bytes / Math.pow(k, i)).toFixed(dm) + (useInternationalSystem ? sizesIS[i] : sizes[i]);
}

static getDatetime(timestamp) {
Expand Down

0 comments on commit ac7af43

Please sign in to comment.