(price: number)
| 250 | } |
| 251 | |
| 252 | function formatPrice(price: number): string { |
| 253 | // Format price: integers without decimals, others with 2 decimal places |
| 254 | // e.g., 3 -> "$3", 0.8 -> "$0.80", 22.5 -> "$22.50" |
| 255 | if (Number.isInteger(price)) { |
| 256 | return `$${price}` |
| 257 | } |
| 258 | return `$${price.toFixed(2)}` |
| 259 | } |
| 260 | |
| 261 | /** |
| 262 | * Format model costs as a pricing string for display |
no outgoing calls
no test coverage detected