Skip to content

chore(web): extract formatUsd into shared lib/format module - #682

Open
escaprt wants to merge 1 commit into
drydocs:mainfrom
escaprt:chore/deduplicate-format-usd
Open

chore(web): extract formatUsd into shared lib/format module#682
escaprt wants to merge 1 commit into
drydocs:mainfrom
escaprt:chore/deduplicate-format-usd

Conversation

@escaprt

@escaprt escaprt commented Aug 31, 2026

Copy link
Copy Markdown

Description

PositionSummary.tsx and DepositTab.tsx both defined a byte-identical ormatUsd(value, locale) helper, creating a DRY violation where locale/currency logic had to be kept in sync by hand.

Changes:

  • New: �pps/web/src/lib/format.ts — exports a single ormatUsd(value, locale) function with the locale-mapping ternary and Intl.NumberFormat options
  • Updated: PositionSummary.tsx — removes local definition, imports from \lib/format\
  • Updated: DepositTab.tsx — removes local definition, imports from \lib/format\

All existing tests pass unchanged.

Closes #654

@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@escaprt Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

@escaprt is attempting to deploy a commit to the Collins' projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

[Chore] formatUsd is duplicated between PositionSummary.tsx and DepositTab.tsx

1 participant