File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ watchEffect(() => {
19
19
});
20
20
21
21
const fileData = computed (() => URL .createObjectURL (props .fileObj .file ));
22
+
23
+ const computeFileSize = (size : number ) =>
24
+ (size / (1024 * 1024 )).toLocaleString (undefined , { minimumFractionDigits: 1 , maximumFractionDigits: 1 }); // NoSonar this is to convert byte to MB
22
25
</script >
23
26
24
27
<template >
@@ -37,9 +40,9 @@ const fileData = computed(() => URL.createObjectURL(props.fileObj.file));
37
40
</a >
38
41
<div >
39
42
<div ><span class =" field-title" >Name:</span > {{ fileObj.file.name }}</div >
40
- <div ><span class =" field-title" >Original Size:</span > {{ (orgSize / (1024 * 1024)).toFixed(1 ) }}MB</div >
43
+ <div ><span class =" field-title" >Original Size:</span > {{ computeFileSize (orgSize) }}MB</div >
41
44
<div v-if =" compSize" >
42
- <span class =" field-title" >Compressed Size:</span > {{ (compSize / (1024 * 1024)).toFixed(1 ) }}MB
45
+ <span class =" field-title" >Compressed Size:</span > {{ computeFileSize (compSize) }}MB
43
46
</div >
44
47
</div >
45
48
<a
You can’t perform that action at this time.
0 commit comments