Skip to content

feat: enhance currency formatting with trailing zero omission#266

Merged
alexmarqs merged 3 commits intomainfrom
feat/add-omittrailingzeros-formatamount-api
Apr 2, 2026
Merged

feat: enhance currency formatting with trailing zero omission#266
alexmarqs merged 3 commits intomainfrom
feat/add-omittrailingzeros-formatamount-api

Conversation

@alexmarqs
Copy link
Copy Markdown
Member

@alexmarqs alexmarqs commented Apr 1, 2026

  • Added support for omitting trailing zeros in formatAmount and formatAmountFromString functions when omitTrailingDoubleZeros is true.
  • Updated tests to verify correct formatting for various locales and amounts, including handling of subunits and zero amounts.

This will allow us to remove duplicated code from ECP and Journeys.

- Added support for omitting trailing zeros in formatAmount and formatAmountFromString functions when omitTrailingDoubleZeros is true.
- Updated tests to verify correct formatting for various locales and amounts, including handling of subunits and zero amounts.
@alexmarqs alexmarqs requested a review from paulofph April 1, 2026 16:45
@alexmarqs alexmarqs marked this pull request as draft April 1, 2026 17:03
- Added omitTrailingDecimalZeros function to remove trailing decimal zeros from formatted price strings.
- Updated exports to include the new function.
- Enhanced tests to verify the correct behavior of the omitTrailingDecimalZeros function across various price formats.
@alexmarqs alexmarqs marked this pull request as ready for review April 2, 2026 09:36
@alexmarqs alexmarqs merged commit 523c644 into main Apr 2, 2026
2 checks passed
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.

2 participants