MCPcopy Index your code
hub / github.com/winfunc/opcode / formatTokens

Function formatTokens

src/components/AgentRunOutputViewer.tsx:525–531  ·  view source on GitHub ↗
(tokens?: number)

Source from the content-addressed store, hash-verified

523 };
524
525 const formatTokens = (tokens?: number) => {
526 if (!tokens) return "0";
527 if (tokens >= 1000) {
528 return `${(tokens / 1000).toFixed(1)}k`;
529 }
530 return tokens.toString();
531 };
532
533 if (!run) {
534 return (

Callers 1

AgentRunOutputViewerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected