From 4a184112ee100eeb8e5e02efb0295588aabbab34 Mon Sep 17 00:00:00 2001 From: chiyi Date: Sat, 8 Aug 2026 22:29:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=E7=A7=AF=E5=88=86=E4=BB=B7=E6=A0=BC?= =?UTF-8?q?=E4=BF=9D=E7=95=99=E4=B8=A4=E4=BD=8D=E5=B0=8F=E6=95=B0=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=86=8D=E5=9B=9B=E8=88=8D=E4=BA=94=E5=85=A5=E6=88=90?= =?UTF-8?q?=E6=95=B4=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/credits.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend/src/credits.js b/frontend/src/credits.js index b250c13..504984b 100644 --- a/frontend/src/credits.js +++ b/frontend/src/credits.js @@ -1,12 +1,13 @@ // Credit display helpers. Credits and model prices are stored server-side as -// integer 积分 (points) — the single unit across the whole app. These helpers -// only format for display; they do NOT convert units. -/** Round to an integer 积分 value. */ +// 积分 (points) — the single unit across the whole app. Prices can be fractional +// (0.11 积分/s), so keep two decimals instead of rounding them away. These +// helpers only format for display; they do NOT convert units. +/** Round to a 积分 value with at most 2 decimals. */ export function points(value) { - return Math.round(Number(value || 0)) + return Math.round(Number(value || 0) * 100) / 100 } /** " 积分" label with thousands separators. */ export function pointsLabel(value) { - return points(value).toLocaleString('en-US') + ' 积分' + return points(value).toLocaleString('en-US', { maximumFractionDigits: 2 }) + ' 积分' }