Skip to content

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

Merged
4pmtong merged 9 commits intoeigent-ai:mainfrom
dev-miro26:feat/format-token-count-with-thousands-separators
Mar 16, 2026
Merged

feat: Format token counts with locale-aware thousands separators#1475
4pmtong merged 9 commits intoeigent-ai:mainfrom
dev-miro26:feat/format-token-count-with-thousands-separators

Conversation

@dev-miro26
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

@dev-miro26
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

Hi, @bytecii
Could you review this PR too?

@dev-miro26
Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Collaborator

@4pmtong 4pmtong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @dev-miro26

@4pmtong 4pmtong merged commit 78be18f into eigent-ai:main Mar 16, 2026
7 checks passed
@fengju0213 fengju0213 added this to the Sprint 19 milestone Mar 19, 2026
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

3 participants