(tokens int)
| 75 | } |
| 76 | |
| 77 | func 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 | } |
no outgoing calls
no test coverage detected