From f3093cf8e08b7882c3e8a5bd8a57e99a00eaeb75 Mon Sep 17 00:00:00 2001 From: xream Date: Tue, 22 Jul 2025 17:39:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B5=81=E9=87=8F=E5=9B=9B=E8=88=8D?= =?UTF-8?q?=E4=BA=94=E5=85=A5=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/utils/flowTransfer.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 70bc93860..0df1fed5e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sub-store-front-end", - "version": "2.15.52", + "version": "2.15.53", "private": true, "scripts": { "dev": "vite --host", diff --git a/src/utils/flowTransfer.ts b/src/utils/flowTransfer.ts index 6638011a4..245b9de3a 100644 --- a/src/utils/flowTransfer.ts +++ b/src/utils/flowTransfer.ts @@ -4,7 +4,7 @@ const flowTransfer = (flow: number, unit: Unit) => { const unitList: Unit[] = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; let unitIndex = unitList.indexOf(unit); return (flow < 1024 || unitIndex === unitList.length - 1) - ? { value: flow.toFixed(1), unit: unit } + ? { value: (Math.round(flow * 100) / 100).toString(), unit: unit } : flowTransfer(flow / 1024, unitList[++unitIndex]); };