* Convert an OpenRouter price string to per-million-token pricing. * Same logic as the existing convert script.
(priceStr: string | undefined)
| 203 | * Same logic as the existing convert script. |
| 204 | */ |
| 205 | function convertPrice(priceStr: string | undefined): number { |
| 206 | const price = parseFloat(priceStr ?? '0') |
| 207 | if (isNaN(price)) return 0 |
| 208 | const result = price * 1_000_000 |
| 209 | return Math.round(result * 1e10) / 1e10 |
| 210 | } |
| 211 | |
| 212 | /** |
| 213 | * Normalize a model ID for comparison. |
no outgoing calls
no test coverage detected