(progress: number | undefined | null)
| 52 | * @param progress - Progress value, typically 0–100. |
| 53 | */ |
| 54 | export function formatProgress(progress: number | undefined | null): string { |
| 55 | const value = Number(progress ?? 0); |
| 56 | const clamped = Math.max(0, Math.min(100, isFinite(value) ? value : 0)); |
| 57 | return `${clamped.toFixed(0)}%`; |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Return the human-readable label for a data type key. |