[FEATURE]: Use K/M compact notation instead of locale myriad units (e.g. "67万") for token counts in Desktop/Web UI

Open Beginner friendly
#68,437 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript

Research direction

Read the compact formatting in packages/gui-plugins/src/context/indicator.tsx (lines 67–71) and packages/app/src/providers/models/details.tsx (lines 157–161), then compare it with packages/tui/src/feature-plugins/system/stats-data.ts. Update the UI formatting so token counts and context limits use K/M notation across locales. Done means Chinese, Japanese, and Korean locales show K/M values consistently in both UI locations.

Written by the indexing model from the issue text.

Description

area/desktop type/feature version/v2
Feature hasn't been suggested before.
  • I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request

In the Desktop / Web UI, when the language is set to Chinese (zh-CN, and similarly zh-TW / ja / ko), compact token counts in the header context indicator are formatted with locale myriad units—e.g. 359,427 tokens shows as 36万 instead of 360k / 359K.

The header context indicator:
image

Total Tokens:
image

In LLM and developer contexts, CJK users universally expect K / M notation for token counts and context windows (128K, 200K, 330K, 1M), matching model specs and other AI coding tools. Seeing 67万 forces a mental ×10 conversion every time and loses precision at 10k boundaries (e.g. 128,000 becomes 12万).

This happens because Intl.NumberFormat passes the UI locale with notation: "compact":

  • packages/gui-plugins/src/context/indicator.tsx (lines 67–71)
  • packages/app/src/providers/models/details.tsx (lines 157–161)

Using "en-US" (as already done in packages/tui/src/feature-plugins/system/stats-data.ts) for compact token / context-limit formatting would keep K / M consistent across all locales.

Dominant language
TypeScript
Stars
230k
Forks
31.3k
Avg merge
5h 44m
Merged PRs (30d)
529

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from anomalyco/opencode

All issues in anomalyco/opencode

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.