From 1b2ea7a1dfdc258ce5010a94919e0d5d210aa91f Mon Sep 17 00:00:00 2001 From: erio Date: Wed, 1 Apr 2026 23:18:03 +0800 Subject: [PATCH] fix(ui): also fix floating point precision in mTokToPerToken --- frontend/src/components/admin/channel/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/admin/channel/types.ts b/frontend/src/components/admin/channel/types.ts index 039e397d..431e3eeb 100644 --- a/frontend/src/components/admin/channel/types.ts +++ b/frontend/src/components/admin/channel/types.ts @@ -36,7 +36,7 @@ export function toNullableNumber(val: number | string | null | undefined): numbe /** 前端显示值($/MTok) → 后端存储值(per-token) */ export function mTokToPerToken(val: number | string | null | undefined): number | null { const num = toNullableNumber(val) - return num === null ? null : num / MTOK + return num === null ? null : parseFloat((num / MTOK).toPrecision(10)) } /** 后端存储值(per-token) → 前端显示值($/MTok) */