fix: Round token counts properly for large numbers

This commit is contained in:
Paul Gauthier (aider) 2024-08-20 09:38:04 -07:00
parent 08fe37a684
commit 455487e5a9

View file

@ -1508,7 +1508,7 @@ class Coder:
elif count < 10000:
return f"{count / 1000:.1f}k"
else:
return f"{count // 1000}k"
return f"{round(count / 1000)}k"
tokens_report = f"Tokens: {format_tokens(self.message_tokens_sent)} sent"