fix:some bug

This commit is contained in:
Lan committed 2024-11-25 18:30:14 +08:00
1 parent a247dd163d
commit 007291a2d9
10 files changed
+239 -87

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
// 存储单位转换
export const getStorageUnit = (value: number) => {
if (value >= 1024 * 1024 * 1024) {
return Math.round(value / (1024 * 1024 * 1024)) + 'GB'
} else if (value >= 1024 * 1024) {
return Math.round(value / (1024 * 1024)) + 'MB'
} else {
return Math.round(value / 1024) + 'KB'
}
}