MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / formatDuration

Function formatDuration

tests/loadtest/tools/dashboard/app.js:1431–1443  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

1429}
1430
1431function formatDuration(value) {
1432 if (value === null || value === undefined) {
1433 return "n/a";
1434 }
1435 const seconds = Math.round(value / 1000);
1436 if (seconds >= 3600) {
1437 return `${(seconds / 3600).toFixed(1)}h`;
1438 }
1439 if (seconds >= 60) {
1440 return `${(seconds / 60).toFixed(1)}m`;
1441 }
1442 return `${seconds}s`;
1443}
1444
1445function formatDecimal(value) {
1446 return value === null || value === undefined ? "n/a" : value.toFixed(2);

Callers 1

renderSummaryGridFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected