[GH-ISSUE #2800] [Bug]: ofx amount parsing does not work for foreign number formats #42776

Closed
opened 2026-04-26 02:52:46 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @Guekka on GitHub (May 25, 2024).
Original GitHub issue: https://github.com/actualbudget/actual/issues/2800

Verified issue does not already exist?

  • I have searched and found no existing issue
  • I will be providing steps how to reproduce the bug (in most cases this will also mean uploading a demo budget file)

What happened?

When importing an OFX file, amounts all appear as NaN. This is due to the code using the naive Number parser: source.

Solution

Using a different parser. I saw number-parsing recommended on SO.

Originally created by @Guekka on GitHub (May 25, 2024). Original GitHub issue: https://github.com/actualbudget/actual/issues/2800 ### Verified issue does not already exist? - [X] I have searched and found no existing issue - [X] I will be providing steps how to reproduce the bug (in most cases this will also mean uploading a demo budget file) ### What happened? When importing an OFX file, amounts all appear as NaN. This is due to the code using the naive `Number` parser: [source](https://github.com/actualbudget/actual/blob/master/packages/loot-core/src/server/accounts/parse-file.ts#L140). ### Solution Using a different parser. I saw [number-parsing](https://www.npmjs.com/package/number-parsing) recommended on SO.
GiteaMirror added the bug label 2026-04-26 02:52:47 -05:00
Author
Owner

@youngcw commented on GitHub (May 25, 2024):

Can you provide an example ofx file?

<!-- gh-comment-id:2131370553 --> @youngcw commented on GitHub (May 25, 2024): Can you provide an example ofx file?
Author
Owner

@Guekka commented on GitHub (May 25, 2024):

Of course, gimme a minute. But any number such as -5,74 will cause a NaN

<!-- gh-comment-id:2131370777 --> @Guekka commented on GitHub (May 25, 2024): Of course, gimme a minute. But any number such as `-5,74` will cause a `NaN`
Author
Owner

@Guekka commented on GitHub (May 25, 2024):

Here you go @youngcw
parsing-number-locale-issue.zip

<!-- gh-comment-id:2131371547 --> @Guekka commented on GitHub (May 25, 2024): Here you go @youngcw [parsing-number-locale-issue.zip](https://github.com/actualbudget/actual/files/15444438/parsing-number-locale-issue.zip)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#42776