mirror of
https://github.com/stablyai/orca.git
synced 2026-10-31 17:17:38 +00:00
Display provider credit and currency balances separately from rate limits. Preserve quotas when balance data is unavailable and translate complete labels. Supersedes #9363; credit to @mmarabel for the original implementation. Co-authored-by: mmarabel <166927047+mmarabel@users.noreply.github.com>
7 lines
275 B
TypeScript
7 lines
275 B
TypeScript
const CREDIT_COUNT_FORMATTER = new Intl.NumberFormat(undefined, { maximumFractionDigits: 20 })
|
|
|
|
export function formatCreditCount(count: number): string {
|
|
const safeCount = Number.isFinite(count) ? Math.max(0, count) : 0
|
|
return CREDIT_COUNT_FORMATTER.format(safeCount)
|
|
}
|