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

Function formatTokens

src/components/UsageDashboard.original.tsx:98–105  ·  view source on GitHub ↗
(num: number)

Source from the content-addressed store, hash-verified

96 };
97
98 const formatTokens = (num: number): string => {
99 if (num >= 1_000_000) {
100 return `${(num / 1_000_000).toFixed(2)}M`;
101 } else if (num >= 1_000) {
102 return `${(num / 1_000).toFixed(1)}K`;
103 }
104 return formatNumber(num);
105 };
106
107 const getModelDisplayName = (model: string): string => {
108 const modelMap: Record<string, string> = {

Callers 1

UsageDashboardFunction · 0.70

Calls 1

formatNumberFunction · 0.85

Tested by

no test coverage detected