Skip to content

Commit db9b0a7

Browse files
committed
fix: convert bytes on decimal scale
1 parent 89060a3 commit db9b0a7

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/utils/constants.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ export const GROUP_AUTO_RELOAD_INTERVAL = 10 * SECOND;
66
export const PDISK_AUTO_RELOAD_INTERVAL = 10 * SECOND;
77
export const VDISK_AUTO_RELOAD_INTERVAL = 10 * SECOND;
88
export const AUTO_RELOAD_INTERVAL = 10 * SECOND;
9+
// by agreement, display all byte values in decimal scale
10+
// values in data are always in bytes, never in higher units,
11+
// therefore there is no issue arbitrary converting them in UI
912
export const MEGABYTE = 1_000_000;
1013
export const GIGABYTE = 1_000_000_000;
1114
export const TERABYTE = 1_000_000_000_000;

src/utils/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import locales from 'numeral/locales'; // eslint-disable-line no-unused-vars
99
numeral.locale(i18n.lang);
1010

1111
export const formatBytes = (bytes) => {
12-
return numeral(bytes).format('0 ib').replace('i', '');
12+
// by agreement, display byte values in decimal scale
13+
return numeral(bytes).format('0 b');
1314
};
1415

1516
export const formatBps = (bytes) => formatBytes(bytes) + '/s';

0 commit comments

Comments
 (0)