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