Skip to content

fix(overview): pin number grouping to en-US so output is locale-indep…#609

Open
NihalJain wants to merge 1 commit into
getagentseal:mainfrom
NihalJain:fix/overview-locale-number-grouping
Open

fix(overview): pin number grouping to en-US so output is locale-indep…#609
NihalJain wants to merge 1 commit into
getagentseal:mainfrom
NihalJain:fix/overview-locale-number-grouping

Conversation

@NihalJain

@NihalJain NihalJain commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

…endent

codeburn overview formatted token/call/session counts with a bare toLocaleString(), which groups digits according to the host's locale. On an Indian-locale machine (en-IN) a value like 2,002,000,000 renders as 2,00,20,00,000, so the rendered summary — and its snapshot test — differed by machine. (formatCost already avoided this via an explicit thousands regex.)

Pin formatTokens to 'en-US' and route the remaining count columns through a new formatCount helper that does the same, so the overview output is byte-identical everywhere.

Verify: npm test -- overview (previously failed on non-US locales; the "thousands separators" case now passes regardless of $LANG / ICU default).

Summary

Testing

  • I have tested this locally against real data (not just unit tests)
  • npm test passes
  • npm run build succeeds

For new providers only:

  • I installed the tool and generated real sessions by using it
  • npm run dev -- today shows correct costs and session counts for this provider
  • npm run dev -- models --provider <name> shows correct model names and pricing
  • Screenshot or terminal output attached below proving it works with real data

…endent

`codeburn overview` formatted token/call/session counts with a bare
`toLocaleString()`, which groups digits according to the host's locale. On an
Indian-locale machine (en-IN) a value like 2,002,000,000 renders as
2,00,20,00,000, so the rendered summary — and its snapshot test — differed by
machine. (formatCost already avoided this via an explicit thousands regex.)

Pin `formatTokens` to 'en-US' and route the remaining count columns through a
new `formatCount` helper that does the same, so the overview output is
byte-identical everywhere.

Verify: `npm test -- overview` (previously failed on non-US locales; the
"thousands separators" case now passes regardless of $LANG / ICU default).
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.

1 participant