[Bug]: ofx amount parsing does not work for foreign number formats #1117

Closed
opened 2026-02-28 19:32:34 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @Guekka on GitHub (May 25, 2024).

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). ### 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-02-28 19:32:34 -06:00
Author
Owner

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

Can you provide an example ofx file?

@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

@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

@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#1117