(bytes?: number | null)
| 169 | } |
| 170 | |
| 171 | export function formatFileSize(bytes?: number | null): string { |
| 172 | if (bytes == null) { |
| 173 | return 'Unknown' |
| 174 | } |
| 175 | |
| 176 | const gb = bytes / (1024 * 1024 * 1024) |
| 177 | if (gb >= 1) { |
| 178 | return `${trimTrailingZeros(gb.toFixed(1))}GB` |
| 179 | } |
| 180 | return `${Math.round(bytes / (1024 * 1024))}MB` |
| 181 | } |
| 182 | |
| 183 | export function formatPrice(price?: number | null): string { |
| 184 | if (price === undefined || price === null) { |
nothing calls this directly
no test coverage detected