We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 130dab2 commit 2d41832Copy full SHA for 2d41832
src/utils/index.js
@@ -20,7 +20,15 @@ export const formatBytes = (bytes) => {
20
return numeral(bytes).format('0 b');
21
};
22
23
-export const formatBps = (bytes) => formatBytes(bytes) + '/s';
+export const formatBps = (bytes) => {
24
+ const formattedBytes = formatBytes(bytes);
25
+
26
+ if (!formattedBytes) {
27
+ return '';
28
+ }
29
30
+ return formattedBytes + '/s';
31
+};
32
33
export const formatBytesToGigabyte = (bytes) => {
34
return `${Math.floor(bytes / GIGABYTE)} GB`;
0 commit comments