mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 11:16:01 +00:00
shell tab
This commit is contained in:
6
packages/web/src/utility/formatFileSize.ts
Normal file
6
packages/web/src/utility/formatFileSize.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export default function formatFileSize(size) {
|
||||
if (size > 1000000000) return `${Math.round(size / 10000000000) * 10} GB`;
|
||||
if (size > 1000000) return `${Math.round(size / 10000000) * 10} MB`;
|
||||
if (size > 1000) return `${Math.round(size / 10000) * 10} KB`;
|
||||
return `${size} bytes`;
|
||||
}
|
||||
Reference in New Issue
Block a user