Skip to content

feat(format): add locale-aware currency formatter and apply to receipt#505

Open
umohjosephemmanuel-cyber wants to merge 1 commit into
Remitwise-Org:mainfrom
umohjosephemmanuel-cyber:feat/add-a-currency/amount
Open

feat(format): add locale-aware currency formatter and apply to receipt#505
umohjosephemmanuel-cyber wants to merge 1 commit into
Remitwise-Org:mainfrom
umohjosephemmanuel-cyber:feat/add-a-currency/amount

Conversation

@umohjosephemmanuel-cyber

@umohjosephemmanuel-cyber umohjosephemmanuel-cyber commented Jun 18, 2026

Copy link
Copy Markdown

CLOSES #467

Description

Amounts were formatted ad hoc across the app — raw numbers in
TransactionSuccessReceipt.tsx, inline arithmetic in app/send/page.tsx, and
split percentages in CurrentMoneySplitWidget.tsx. This PR introduces a single
formatCurrency/formatAmount utility and applies it consistently across all
high-visibility financial surfaces.

Inconsistent number formatting (decimals, thousands separators, currency
symbols) on a financial product erodes trust and breaks for non-US locales.

──────────────────────────────────────────────────────────────────────────────

Changes

  • lib/utils/format-currency.ts — new formatCurrency(amount, currency, locale,
    options) utility using Intl.NumberFormat, with graceful fallback (1,234.50
    USDC) for stablecoin codes that Intl does not recognize
  • lib/utils/format-currency.test.ts — Vitest unit tests covering: USD/en-US,
    negative values, zero, USDC stablecoin fallback, es-ES locale separators, and
    formatAmount alias
  • components/TransactionSuccessReceipt.tsx — applied formatCurrency to all
    displayed amounts
  • components/CurrentMoneySplitWidget.tsx — applied formatter to split
    percentages/amounts
  • app/send/page.tsx, AutomaticSplitCard.tsx, ReviewStep.tsx — applied
    formatter to send flow breakdown

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.

Add a currency/amount formatting utility and apply it in TransactionSuccessReceipt and CurrentMoneySplitWidget

1 participant