mirror of
https://github.com/zyycn/codex-proxy-rs.git
synced 2026-11-06 08:06:19 +00:00
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 <noreply@openai.com>
This commit is contained in:
@@ -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 })
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user