File tree Expand file tree Collapse file tree
apps/sim/app/workspace/[workspaceId]/logs/components/log-details/components/trace-spans Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import {
1919 Search as SearchIcon ,
2020 Tooltip ,
2121} from '@/components/emcn'
22+ import { dollarsToCredits } from '@/lib/billing/credits/conversion'
2223import { cn } from '@/lib/core/utils/cn'
2324import type { TraceSpan } from '@/lib/logs/types'
2425import {
@@ -59,8 +60,9 @@ function useSetToggle() {
5960
6061function formatCostAmount ( value : number | undefined ) : string | undefined {
6162 if ( typeof value !== 'number' || ! Number . isFinite ( value ) || value <= 0 ) return undefined
62- if ( value < 0.0001 ) return '<$0.0001'
63- return `$${ value . toFixed ( 4 ) } `
63+ const credits = dollarsToCredits ( value )
64+ if ( credits <= 0 ) return '<1 credit'
65+ return `${ credits . toLocaleString ( 'en-US' ) } ${ credits === 1 ? 'credit' : 'credits' } `
6466}
6567
6668function formatCostSummary ( cost : TraceSpan [ 'cost' ] ) : string | undefined {
You can’t perform that action at this time.
0 commit comments