MCPcopy
hub / github.com/phuryn/claude-usage / fmt

Function fmt

cli.py:69–74  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

67 )
68
69def fmt(n):
70 if n >= 1_000_000:
71 return f"{n/1_000_000:.2f}M"
72 if n >= 1_000:
73 return f"{n/1_000:.1f}K"
74 return str(n)
75
76def fmt_cost(c):
77 return f"${c:.4f}"

Callers 6

test_millionsMethod · 0.90
test_thousandsMethod · 0.90
test_small_numbersMethod · 0.90
cmd_todayFunction · 0.85
cmd_weekFunction · 0.85
cmd_statsFunction · 0.85

Calls

no outgoing calls

Tested by 3

test_millionsMethod · 0.72
test_thousandsMethod · 0.72
test_small_numbersMethod · 0.72