Files
orca/src/shared/credit-count-format.ts
T
Neil a90ff597be Show whole credit balances in usage displays (#28887)
* fix: limit credit balances to two decimal places

* fix: show whole credits in usage displays
2026-10-14 17:04:24 -07:00

7 lines
274 B
TypeScript

const CREDIT_COUNT_FORMATTER = new Intl.NumberFormat(undefined, { maximumFractionDigits: 0 })
export function formatCreditCount(count: number): string {
const safeCount = Number.isFinite(count) ? Math.max(0, count) : 0
return CREDIT_COUNT_FORMATTER.format(safeCount)
}