update user files info
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
export function convertBytes(bytes: number) {
|
||||
const units = ['B', 'KB', 'MB', 'GB', 'TB'];
|
||||
|
||||
if (bytes === 0) return '0 B';
|
||||
|
||||
let i = 0;
|
||||
let value = bytes;
|
||||
|
||||
while (value >= 1024 && i < units.length - 1) {
|
||||
value /= 1024;
|
||||
i++;
|
||||
}
|
||||
|
||||
return `${value.toFixed(1)} ${units[i]}`;
|
||||
}
|
||||
Reference in New Issue
Block a user