MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / formatTokenCount

Function formatTokenCount

ui/context_status.go:77–88  ·  view source on GitHub ↗
(tokens int)

Source from the content-addressed store, hash-verified

75}
76
77func formatTokenCount(tokens int) string {
78 if tokens < 0 {
79 tokens = 0
80 }
81 if tokens >= 1_000_000 {
82 return fmt.Sprintf("%.1fM", float64(tokens)/1_000_000)
83 }
84 if tokens >= 1000 {
85 return fmt.Sprintf("%dK", tokens/1000)
86 }
87 return fmt.Sprintf("%d", tokens)
88}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected