diff --git a/package.json b/package.json index c0a94b585..0ffc5339d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sub-store-front-end", - "version": "2.14.212", + "version": "2.14.213", "private": true, "scripts": { "dev": "vite --host", diff --git a/src/utils/flowTransfer.ts b/src/utils/flowTransfer.ts index 4bd7cbcf7..6638011a4 100644 --- a/src/utils/flowTransfer.ts +++ b/src/utils/flowTransfer.ts @@ -1,10 +1,9 @@ -type Unit = 'B' | 'KB' | 'MB' | 'GB' | 'TB' | 'PB' | 'EB'; +type Unit = 'B' | 'KB' | 'MB' | 'GB' | 'TB' | 'PB' | 'EB' | 'ZB' | 'YB'; const flowTransfer = (flow: number, unit: Unit) => { - const unitList: Unit[] = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB']; + const unitList: Unit[] = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; let unitIndex = unitList.indexOf(unit); - - return flow < 1024 + return (flow < 1024 || unitIndex === unitList.length - 1) ? { value: flow.toFixed(1), unit: unit } : flowTransfer(flow / 1024, unitList[++unitIndex]); };