(value)
| 1397 | } |
| 1398 | |
| 1399 | function formatCompact(value) { |
| 1400 | if (value === null || value === undefined) { |
| 1401 | return "n/a"; |
| 1402 | } |
| 1403 | return new Intl.NumberFormat(undefined, { |
| 1404 | notation: value >= 10000 ? "compact" : "standard", |
| 1405 | maximumFractionDigits: value >= 100 ? 0 : 2, |
| 1406 | }).format(value); |
| 1407 | } |
| 1408 | |
| 1409 | function formatRate(value) { |
| 1410 | return value === null || value === undefined ? "n/a" : `${formatCompact(value)}/sec`; |
no outgoing calls
no test coverage detected