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

Function formatProgress

frontend/tests/app.unit.test.js:42–45  ·  view source on GitHub ↗

* Format transmission progress (0–100) to a percentage string. * Mirrors app.js `methods.formatProgress`.

(progress)

Source from the content-addressed store, hash-verified

40 * Mirrors app.js `methods.formatProgress`.
41 */
42function formatProgress(progress) {
43 const value = Number(progress || 0);
44 return `${Math.max(0, Math.min(100, value)).toFixed(0)}%`;
45}
46
47/**
48 * Format simulation seconds to "HH:MM:SS".

Callers 1

app.unit.test.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected