Skip to content

Commit 988398a

Browse files
committed
Fix $0.0000 display for near-zero costs
Closes #205
1 parent 6702d55 commit 988398a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/currency.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,5 +151,6 @@ export function formatCost(costUSD: number): string {
151151

152152
if (cost >= 1) return `${symbol}${cost.toFixed(2)}`
153153
if (cost >= 0.01) return `${symbol}${cost.toFixed(3)}`
154-
return `${symbol}${cost.toFixed(4)}`
154+
if (cost >= 0.0001) return `${symbol}${cost.toFixed(4)}`
155+
return `${symbol}${cost.toFixed(2)}`
155156
}

0 commit comments

Comments
 (0)