[GH-ISSUE #90] Replace currency-formatter with Intl.NumberFormat to reduce dependencies #69839

Closed
opened 2026-05-16 07:17:03 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @TomAFrench on GitHub (Jun 15, 2022).
Original GitHub issue: https://github.com/actualbudget/actual/issues/90

We've currently got a dependency on a fork of currency-formatter which in turn depends on a fork of accounting.js (both maintained by jlongster). This is only used twice in the entire codebase.

b4696ce598/packages/loot-core/src/shared/util.js (L289-L294)

b4696ce598/packages/loot-core/src/shared/util.js (L322-L324)

As mentioned in the comment if we switch to use Intl.NumberFormat then we can ditch these dependencies as they're not particularly necessary. Intl is well supported in the main mobile browsers now.

Originally created by @TomAFrench on GitHub (Jun 15, 2022). Original GitHub issue: https://github.com/actualbudget/actual/issues/90 We've currently got a dependency on a fork of `currency-formatter` which in turn depends on a fork of ` accounting.js` (both maintained by jlongster). This is only used twice in the entire codebase. https://github.com/actualbudget/actual/blob/b4696ce5989a79065f6ef30dd32cff7e59044852/packages/loot-core/src/shared/util.js#L289-L294 https://github.com/actualbudget/actual/blob/b4696ce5989a79065f6ef30dd32cff7e59044852/packages/loot-core/src/shared/util.js#L322-L324 As mentioned in the comment if we switch to use [Intl.NumberFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) then we can ditch these dependencies as they're not particularly necessary. Intl is [well supported](https://caniuse.com/?search=intl.numberformat) in the main mobile browsers now.
Author
Owner

@trevdor commented on GitHub (Jun 17, 2022):

@TomAFrench Have you done this work yet?

<!-- gh-comment-id:1158985452 --> @trevdor commented on GitHub (Jun 17, 2022): @TomAFrench Have you done this work yet?
Author
Owner

@trevdor commented on GitHub (Jun 17, 2022):

Ooh, that could sound like, "Why don't you hurry up and do it!?!" I meant, I have formatting working with Int.NumberFormat on a branch of mine, and can open a PR if I won't be stepping on your work already completed.

<!-- gh-comment-id:1158988454 --> @trevdor commented on GitHub (Jun 17, 2022): Ooh, that could sound like, "Why don't you hurry up and do it!?!" I meant, I have formatting working with `Int.NumberFormat` on a branch of mine, and can open a PR if I won't be stepping on your work already completed.
Author
Owner

@TomAFrench commented on GitHub (Jun 17, 2022):

Nope, I was planning on tackling it this weekend. If you've got a branch ready then feel free to make a PR, I'd be happy to take a look and give feedback.

<!-- gh-comment-id:1159004286 --> @TomAFrench commented on GitHub (Jun 17, 2022): Nope, I was planning on tackling it this weekend. If you've got a branch ready then feel free to make a PR, I'd be happy to take a look and give feedback.
Author
Owner

@trevdor commented on GitHub (Jun 17, 2022):

Would love feedback. Just linked ☝🏻

<!-- gh-comment-id:1159033806 --> @trevdor commented on GitHub (Jun 17, 2022): Would love feedback. Just linked ☝🏻
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#69839