From 73487fd98be5a9df1ca8a7a35018ea969f2be294 Mon Sep 17 00:00:00 2001 From: Zyy Date: Fri, 11 Sep 2026 16:08:20 +0800 Subject: [PATCH] fix(api-keys): trim trailing zeros from budget amounts Display budget amounts with up to two decimal places without padding trailing zeros. Keep exact amounts in the details popover and preserve accounting precision. Validation: frontend lint/type checks/build and browser checks passed. Co-authored-by: Codex --- frontend/src/views/api-keys/components/ApiKeyBudgetCell.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/api-keys/components/ApiKeyBudgetCell.vue b/frontend/src/views/api-keys/components/ApiKeyBudgetCell.vue index a2bfc82ee..4f9eaf935 100644 --- a/frontend/src/views/api-keys/components/ApiKeyBudgetCell.vue +++ b/frontend/src/views/api-keys/components/ApiKeyBudgetCell.vue @@ -10,8 +10,8 @@ const windows = computed(() => [ { label: '周', heading: '周用量', used: props.apiKey.weeklyUsedUsd, limit: props.apiKey.weeklyLimitUsd, reset: props.apiKey.weeklyResetsAt }, ]) function amount(value: string) { - // 列表显示两位小数,明细直接使用原始字符串,保留全部金额精度。 - return Number(value).toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) + // 列表最多显示两位小数,不补末尾零;明细保留原始金额的全部精度。 + return Number(value).toLocaleString('en-US', { maximumFractionDigits: 2 }) }