MCPcopy Create free account
hub / github.com/winfunc/opcode / formatTokens

Function formatTokens

src/components/AgentRunsList.tsx:72–78  ·  view source on GitHub ↗
(tokens?: number)

Source from the content-addressed store, hash-verified

70 };
71
72 const formatTokens = (tokens?: number) => {
73 if (!tokens) return "0";
74 if (tokens >= 1000) {
75 return `${(tokens / 1000).toFixed(1)}k`;
76 }
77 return tokens.toString();
78 };
79
80 const handleRunClick = (run: AgentRunWithMetrics) => {
81 // If there's a callback, use it (for full-page navigation)

Callers 2

AgentRunsListFunction · 0.70
UsageDashboardFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected