Skip to content

feat: Format token counts with locale-aware thousands separators#1475

Open
dev-miro26 wants to merge 7 commits intoeigent-ai:mainfrom
dev-miro26:feat/format-token-count-with-thousands-separators
Open

feat: Format token counts with locale-aware thousands separators#1475
dev-miro26 wants to merge 7 commits intoeigent-ai:mainfrom
dev-miro26:feat/format-token-count-with-thousands-separators

Conversation

@dev-miro26
Copy link
Contributor

@dev-miro26 dev-miro26 commented Mar 9, 2026

Related Issue

Closes #1434

Description

The token count displayed in the bottom-left of the app (and in the history sidebar) can be hard to read when large numbers are involved (e.g. 19994406).

This PR adds locale-aware thousands separators to all token count displays by using Number.toLocaleString(), so the value renders as 19,994,406 (en-US), 19.994.406 (de-DE), etc., depending on the user's regional settings.

Files changed:

  • src/components/ChatBox/HeaderBox/index.tsx: Chat header token count
  • src/components/HistorySidebar/index.tsx: Active and history project token counts and update stylelint

Note: GroupedHistoryView components already used .toLocaleString() — no changes needed there.

Testing Evidence (REQUIRED)

eigent-issue1434.mp4
  • I have included human-verified testing evidence in this PR.
  • This PR includes frontend/UI changes, and I attached screenshot(s) or screen recording(s).
  • No frontend/UI changes in this PR.

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

@dev-miro26
Copy link
Contributor Author

Hi, @4pmtong @Wendong-Fan
Could you review my first PR? Please left your feedback kindly.
Thanks

@dev-miro26
Copy link
Contributor Author

Hi @4pmtong
I am sorry, I know you are so busy. If you don't mind I hope you review this my first PR and leave the feedback kindly.
Thank you.

@dev-miro26
Copy link
Contributor Author

Hi, @bytecii
Could you review this PR too?

@dev-miro26
Copy link
Contributor Author

Hi @4pmtong
Could you please review this PR too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Friendly format for token count

1 participant