Skip to content

Commit b17ecda

Browse files
Fixing file size logic
1 parent 632e1bb commit b17ecda

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/components/Attachment/FileAttachment.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,11 @@ const goToURL = (url) => {
5454
const getFileSizeDisplayText = (size) => {
5555
if (!size) return;
5656

57-
if (size < 1000) {
58-
return `${size} KB`;
59-
}
60-
6157
if (size < 1000 * 1000) {
62-
return `${size / 1000} MB`;
58+
return `${Math.floor(size / 10) / 100} KB`;
6359
}
6460

65-
return `${size / (1000 * 1000)} GB`;
61+
return `${Math.floor(size / 10000) / 100} MB`;
6662
};
6763

6864
const FileAttachment = ({

0 commit comments

Comments
 (0)