Skip to content

fix(currency): use narrow symbol so non-EN locales show $ not USD#616

Merged
Agilulfo1820 merged 1 commit into
mainfrom
fix/currency-narrow-symbol
May 15, 2026
Merged

fix(currency): use narrow symbol so non-EN locales show $ not USD#616
Agilulfo1820 merged 1 commit into
mainfrom
fix/currency-narrow-symbol

Conversation

@Agilulfo1820
Copy link
Copy Markdown
Member

Summary

  • Intl.NumberFormat in non-US locales (e.g. it-IT) renders USD as "1,23 USD" because $ is ambiguous outside the US. The wider USD glyph overflows several balance/price components.
  • Pass currencyDisplay: 'narrowSymbol' in formatCurrencyValue so the compact symbol is used regardless of locale, while locale number grouping and symbol placement are preserved.
  • Applies to every caller of formatCurrencyValue / formatCompactCurrency (AssetButton, useTotalBalance, AssetsHeader, TokenDetailContent, …).

Before / after

Locale Currency Before After
it-IT USD 1,23 USD 1,23 $
de-DE EUR 1,23 € 1,23 € (unchanged)
en-US USD $1.23 $1.23 (unchanged)

Test plan

  • Switch language to Italian in the account modal and verify USD balances render with $ and no longer overflow.
  • Repeat for at least one other non-English locale (e.g. French, Spanish).
  • Verify EUR and GBP currencies still render with / £ across locales.
  • Verify English (US) display is unchanged.

🤖 Generated with Claude Code

Why: Intl.NumberFormat defaults to disambiguated forms (e.g. "1,23 USD"
in it-IT) because "$" is ambiguous outside the US. The wider "USD"
glyph overflows in several balance/price components. currencyDisplay:
'narrowSymbol' forces the compact symbol while preserving locale
number grouping and symbol placement.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

Warning

Rate limit exceeded

@Agilulfo1820 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 45 minutes and 8 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4f276e4e-9892-4364-8b2d-be81a9570221

📥 Commits

Reviewing files that changed from the base of the PR and between 1a949bb and c2c28f7.

📒 Files selected for processing (1)
  • packages/vechain-kit/src/utils/currencyUtils.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/currency-narrow-symbol

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

Size Change: -2.41 kB (-0.03%)

Total Size: 8.47 MB

Filename Size Change
packages/vechain-kit/dist/index-B7W1mM8I.d.mts 0 B -5.63 kB (removed) 🏆
packages/vechain-kit/dist/index-B7W1mM8I.d.mts.map 0 B -2.99 kB (removed) 🏆
packages/vechain-kit/dist/index-BxOnagqX.d.cts 0 B -170 kB (removed) 🏆
packages/vechain-kit/dist/index-BxOnagqX.d.cts.map 0 B -46.8 kB (removed) 🏆
packages/vechain-kit/dist/index-DVPTcJRO.d.cts 0 B -5.63 kB (removed) 🏆
packages/vechain-kit/dist/index-DVPTcJRO.d.cts.map 0 B -2.99 kB (removed) 🏆
packages/vechain-kit/dist/index-WfFCfbMx.d.mts 0 B -170 kB (removed) 🏆
packages/vechain-kit/dist/index-WfFCfbMx.d.mts.map 0 B -46.8 kB (removed) 🏆
packages/vechain-kit/dist/index.cjs.map 2.69 MB -1.07 kB (-0.04%)
packages/vechain-kit/dist/index.mjs.map 2.63 MB -1.06 kB (-0.04%)
packages/vechain-kit/dist/index-Bekk3wer.d.cts 5.63 kB +5.63 kB (new file) 🆕
packages/vechain-kit/dist/index-Bekk3wer.d.cts.map 2.99 kB +2.99 kB (new file) 🆕
packages/vechain-kit/dist/index-BKTLu7P5.d.mts 170 kB +170 kB (new file) 🆕
packages/vechain-kit/dist/index-BKTLu7P5.d.mts.map 46.8 kB +46.8 kB (new file) 🆕
packages/vechain-kit/dist/index-BwtTabHc.d.mts 5.63 kB +5.63 kB (new file) 🆕
packages/vechain-kit/dist/index-BwtTabHc.d.mts.map 2.99 kB +2.99 kB (new file) 🆕
packages/vechain-kit/dist/index-DYUOWqNG.d.cts 170 kB +170 kB (new file) 🆕
packages/vechain-kit/dist/index-DYUOWqNG.d.cts.map 46.8 kB +46.8 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size Change
packages/vechain-kit/dist/assets 4.1 kB 0 B
packages/vechain-kit/dist/assets-BL24r-Yp.mjs 51.3 kB 0 B
packages/vechain-kit/dist/assets-BL24r-Yp.mjs.map 74.1 kB 0 B
packages/vechain-kit/dist/assets-DNJsQD7_.cjs 58.5 kB 0 B
packages/vechain-kit/dist/assets-DNJsQD7_.cjs.map 75.5 kB 0 B
packages/vechain-kit/dist/assets/index.cjs 716 B 0 B
packages/vechain-kit/dist/assets/index.d.cts 973 B 0 B
packages/vechain-kit/dist/assets/index.d.mts 973 B 0 B
packages/vechain-kit/dist/assets/index.mjs 718 B 0 B
packages/vechain-kit/dist/index.cjs 1.11 MB -191 B (-0.02%)
packages/vechain-kit/dist/index.d.cts 22.8 kB 0 B
packages/vechain-kit/dist/index.d.mts 22.8 kB 0 B
packages/vechain-kit/dist/index.mjs 1.07 MB -141 B (-0.01%)
packages/vechain-kit/dist/utils 4.1 kB 0 B
packages/vechain-kit/dist/utils-DJKLAzLP.cjs 27.2 kB 0 B
packages/vechain-kit/dist/utils-DJKLAzLP.cjs.map 67.2 kB 0 B
packages/vechain-kit/dist/utils-KYzX9d5n.mjs 22.1 kB 0 B
packages/vechain-kit/dist/utils-KYzX9d5n.mjs.map 66.5 kB 0 B
packages/vechain-kit/dist/utils/index.cjs 1.98 kB 0 B
packages/vechain-kit/dist/utils/index.d.cts 3.04 kB 0 B
packages/vechain-kit/dist/utils/index.d.mts 3.04 kB 0 B
packages/vechain-kit/dist/utils/index.mjs 2 kB 0 B

compressed-size-action

@Agilulfo1820 Agilulfo1820 merged commit 642b3af into main May 15, 2026
7 checks passed
@Agilulfo1820 Agilulfo1820 deleted the fix/currency-narrow-symbol branch May 15, 2026 05:49
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