mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-27 01:20:57 -05:00
9 lines
206 B
TypeScript
9 lines
206 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`;
|
|
}
|