MCPcopy Create free account
hub / github.com/Tong89/smartNode / formatProgress

Function formatProgress

frontend/src/utils/format.ts:54–58  ·  view source on GitHub ↗
(progress: number | undefined | null)

Source from the content-addressed store, hash-verified

52 * @param progress - Progress value, typically 0–100.
53 */
54export 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.

Callers 1

format.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected