mirror of
https://github.com/stablyai/orca.git
synced 2026-11-02 10:08:13 +00:00
* fix: limit credit balances to two decimal places * fix: show whole credits in usage displays
7 lines
274 B
TypeScript
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)
|
|
}
|