MCPcopy Index your code
hub / github.com/usestrix/strix / format_token_count

Function format_token_count

strix/interface/utils.py:49–55  ·  view source on GitHub ↗
(count: float | None)

Source from the content-addressed store, hash-verified

47
48
49def format_token_count(count: float | None) -> str:
50 value = int(count or 0)
51 if value >= 1_000_000:
52 return f"{value / 1_000_000:.1f}M"
53 if value >= 1_000:
54 return f"{value / 1_000:.1f}K"
55 return str(value)
56
57
58def format_vulnerability_report(report: dict[str, Any]) -> Text: # noqa: PLR0915

Callers 2

_build_llm_usage_statsFunction · 0.85
build_tui_stats_textFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected