MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / formatTokenCount

Function formatTokenCount

server/src/utils/token-limiter.ts:397–402  ·  view source on GitHub ↗
(tokens: number)

Source from the content-addressed store, hash-verified

395 * Format a token count for logging (e.g., "150K")
396 */
397export function formatTokenCount(tokens: number): string {
398 if (tokens >= 1000) {
399 return `${Math.round(tokens / 1000)}K`;
400 }
401 return String(tokens);
402}

Callers 3

processMessageMethod · 0.85
processMessageStreamMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected