Skip to content

Commit

Permalink
Fix IEC (1024) formatting
Browse files Browse the repository at this point in the history
Avoid adding double "i".
  • Loading branch information
Quphoria authored Oct 30, 2023
1 parent 558e198 commit 9155b8d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ function displayTable(tb, settings) {
}

function formatSize(size, useBits, useMultiple) {
var res = String.format('%%%s.2m%s'.format(useMultiple, (useBits ? 'bit' : 'B')), useBits ? size * 8 : size);
return useMultiple == '1024' ? res.replace(/([KMGTPEZ])/, '$&i') : res;
// String.format automatically adds the i for KiB if the multiple is 1024
return String.format('%%%s.2m%s'.format(useMultiple, (useBits ? 'bit' : 'B')), useBits ? size * 8 : size);
}

function formatSpeed(speed, useBits, useMultiple) {
Expand Down

0 comments on commit 9155b8d

Please sign in to comment.