Skip to content

Commit ad5f50f

Browse files
committed
fix(trace): fix sub-credit display, locale, and pluralization in formatCostAmount
1 parent 6be088d commit ad5f50f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • apps/sim/app/workspace/[workspaceId]/logs/components/log-details/components/trace-view

apps/sim/app/workspace/[workspaceId]/logs/components/log-details/components/trace-view/trace-view.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ function formatTokenCount(value: number | undefined): string | undefined {
195195
function formatCostAmount(value: number | undefined): string | undefined {
196196
if (typeof value !== 'number' || !Number.isFinite(value) || value <= 0) return undefined
197197
const credits = dollarsToCredits(value)
198-
if (credits <= 0) return undefined
199-
return `${credits.toLocaleString()} credits`
198+
if (credits <= 0) return '<1 credit'
199+
return `${credits.toLocaleString('en-US')} ${credits === 1 ? 'credit' : 'credits'}`
200200
}
201201

202202
function formatTtft(ms: number | undefined): string | undefined {

0 commit comments

Comments
 (0)