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

Function format_compact

tests/loadtest/tools/dashboard_parser.py:474–483  ·  view source on GitHub ↗
(value: float | None)

Source from the content-addressed store, hash-verified

472
473
474def format_compact(value: float | None) -> str:
475 if value is None:
476 return "n/a"
477 if value >= 1_000_000:
478 return f"{value / 1_000_000:.1f}M"
479 if value >= 1_000:
480 return f"{value / 1_000:.1f}k"
481 if value.is_integer():
482 return str(int(value))
483 return f"{value:.1f}"
484
485
486def format_rate(value: float | None) -> str:

Callers 3

build_statsFunction · 0.85
format_rateFunction · 0.85
format_tpmFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected