formatTokenCount formats a token count with K/M suffixes for readability.
(tokens int64)
| 196 | |
| 197 | // formatTokenCount formats a token count with K/M suffixes for readability. |
| 198 | func formatTokenCount(tokens int64) string { |
| 199 | if tokens >= 1_000_000 { |
| 200 | return fmt.Sprintf("%.1fM", float64(tokens)/1_000_000) |
| 201 | } |
| 202 | if tokens >= 1_000 { |
| 203 | return fmt.Sprintf("%.1fK", float64(tokens)/1_000) |
| 204 | } |
| 205 | return fmt.Sprintf("%d", tokens) |
| 206 | } |
| 207 | |
| 208 | // printContextInfo imprime informações detalhadas de um contexto |
| 209 | func (h *ContextHandler) printContextInfo(ctx *ctxmgr.FileContext, detailed bool) { |
no outgoing calls