MCPcopy Create free account
hub / github.com/codeaashu/claude-code / formatGrantAmount

Function formatGrantAmount

src/services/api/overageCreditGrant.ts:127–135  ·  view source on GitHub ↗
(info: OverageCreditGrantInfo)

Source from the content-addressed store, hash-verified

125 * (not eligible, or currency we don't know how to format).
126 */
127export function formatGrantAmount(info: OverageCreditGrantInfo): string | null {
128 if (info.amount_minor_units == null || !info.currency) return null
129 // For now only USD; backend may expand later
130 if (info.currency.toUpperCase() === 'USD') {
131 const dollars = info.amount_minor_units / 100
132 return Number.isInteger(dollars) ? `$${dollars}` : `$${dollars.toFixed(2)}`
133 }
134 return null
135}
136
137export type { CachedGrantEntry as OverageCreditGrantCacheEntry }
138

Callers 4

OverageCreditUpsellFunction · 0.85
createOverageCreditFeedFunction · 0.85
tipRegistry.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected