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

Function formatBytes

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

Source from the content-addressed store, hash-verified

1447}
1448
1449function formatBytes(value) {
1450 if (value === null || value === undefined) {
1451 return "n/a";
1452 }
1453 const units = ["B", "KB", "MB", "GB", "TB"];
1454 let current = value;
1455 let index = 0;
1456 while (current >= 1024 && index < units.length - 1) {
1457 current /= 1024;
1458 index += 1;
1459 }
1460 return `${current.toFixed(1)} ${units[index]}`;
1461}
1462
1463function formatThresholdStatus(value) {
1464 return value ? "Pass" : "Fail";

Callers 1

buildStatsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected