(price: number)
| 204 | } |
| 205 | |
| 206 | function formatPrice(price: number): string { |
| 207 | // Format price: integers without decimals, others with 2 decimal places |
| 208 | // e.g., 3 -> "$3", 0.8 -> "$0.80", 22.5 -> "$22.50" |
| 209 | if (Number.isInteger(price)) { |
| 210 | return `$${price}` |
| 211 | } |
| 212 | return `$${price.toFixed(2)}` |
| 213 | } |
| 214 | |
| 215 | /** |
| 216 | * Format model costs as a pricing string for display |
no outgoing calls
no test coverage detected