(info: OverageCreditGrantInfo)
| 125 | * (not eligible, or currency we don't know how to format). |
| 126 | */ |
| 127 | export 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 | |
| 137 | export type { CachedGrantEntry as OverageCreditGrantCacheEntry } |
| 138 |
no outgoing calls
no test coverage detected