Skip to content

Commit 3f98675

Browse files
committed
feat: 流量四舍五入优化
1 parent 8ab694e commit 3f98675

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sub-store",
3-
"version": "2.19.91",
3+
"version": "2.19.92",
44
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
55
"main": "src/main.js",
66
"scripts": {

backend/src/utils/flow.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ export function flowTransfer(flow, unit = 'B') {
230230
let unitIndex = unitList.indexOf(unit);
231231

232232
return flow < 1024 || unitIndex === unitList.length - 1
233-
? { value: flow.toFixed(1), unit: unit }
233+
? { value: (Math.round(flow * 100) / 100).toString(), unit: unit }
234234
: flowTransfer(flow / 1024, unitList[++unitIndex]);
235235
}
236236

0 commit comments

Comments
 (0)