(price?: number | null)
| 181 | } |
| 182 | |
| 183 | export function formatPrice(price?: number | null): string { |
| 184 | if (price === undefined || price === null) { |
| 185 | return 'N/A' |
| 186 | } |
| 187 | |
| 188 | const formatter = price > 0 && price < 0.001 ? PRICE_NUMBER_FORMAT_4 : PRICE_NUMBER_FORMAT_3 |
| 189 | |
| 190 | return `$${trimTrailingZeros(formatter.format(price))}` |
| 191 | } |
| 192 | |
| 193 | export function formatUpdatedAt(date: string): string { |
| 194 | try { |
no test coverage detected