mirror of
https://github.com/revoltchat/revite.git
synced 2024-12-27 07:52:11 -05:00
9 lines
230 B
TypeScript
9 lines
230 B
TypeScript
export function determineFileSize(size: number) {
|
|
if (size > 1e6) {
|
|
return `${(size / 1e6).toFixed(2)} MB`;
|
|
} else if (size > 1e3) {
|
|
return `${(size / 1e3).toFixed(2)} KB`;
|
|
}
|
|
|
|
return `${size} B`;
|
|
}
|