[GH-ISSUE #1051] [Bug]: Importing cents imports as whole numbers if no leading zero #7349

Closed
opened 2026-04-10 17:08:22 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @kstockk on GitHub (May 20, 2023).
Original GitHub issue: https://github.com/actualbudget/actual/issues/1051

Verified issue does not already exist?

  • I have searched and found no existing issue

What happened?

When importing cents with no leading zero from a CSV file, they are converted to whole numbers instead of cents.

For example:
Date,Description,Debit,Credit
17/05/2023,Transaction,,.47,

This csv imports as $47 where it should be $0.47

What error did you receive?

No response

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

No response

Operating System

None

Originally created by @kstockk on GitHub (May 20, 2023). Original GitHub issue: https://github.com/actualbudget/actual/issues/1051 ### Verified issue does not already exist? - [X] I have searched and found no existing issue ### What happened? When importing cents with no leading zero from a CSV file, they are converted to whole numbers instead of cents. For example: Date,Description,Debit,Credit 17/05/2023,Transaction,,.47, This csv imports as $47 where it should be $0.47 ### What error did you receive? _No response_ ### Where are you hosting Actual? Docker ### What browsers are you seeing the problem on? _No response_ ### Operating System None
GiteaMirror added the transaction importbug labels 2026-04-10 17:08:22 -05:00
Author
Owner

@j-f1 commented on GitHub (May 20, 2023):

Related: #1029 (cc @chylex)

<!-- gh-comment-id:1555900716 --> @j-f1 commented on GitHub (May 20, 2023): Related: #1029 (cc @chylex)
Author
Owner

@chylex commented on GitHub (May 20, 2023):

Related: #1029 (cc @chylex)

Parsing numbers with no integral parts is covered by the handles division test, maybe the problem is with the CSV parser?

<!-- gh-comment-id:1555922675 --> @chylex commented on GitHub (May 20, 2023): > Related: #1029 (cc @chylex) Parsing numbers with no integral parts is covered by the `handles division` test, maybe the problem is with the CSV parser?
Author
Owner

@j-f1 commented on GitHub (May 20, 2023):

Oh yes, sorry. The code path for imports is completely separate from the code path for typing in numbers.

<!-- gh-comment-id:1555930483 --> @j-f1 commented on GitHub (May 20, 2023): Oh yes, sorry. The code path for imports is completely separate from the code path for typing in numbers.
Author
Owner

@Shazib commented on GitHub (Jun 21, 2023):

I believe the offending line causing this is somewhere here where it ends up inside extractNumbers and removes the leading decimal. I think that match fails.

<!-- gh-comment-id:1601575254 --> @Shazib commented on GitHub (Jun 21, 2023): I believe the offending line causing this is somewhere [here](https://github.com/actualbudget/actual/blob/287fb9b9d67e6643eb9d0062f17d415e1d76b033/packages/loot-core/src/shared/util.ts#L399) where it ends up inside extractNumbers and removes the leading decimal. I think that match fails.
Author
Owner

@jhollowe commented on GitHub (Jun 19, 2024):

Just as a note, this also affects QIF files (I think it would affect any import since they use the same number parsing code path)

<!-- gh-comment-id:2178918266 --> @jhollowe commented on GitHub (Jun 19, 2024): Just as a note, this also affects QIF files (I think it would affect any import since they use the same number parsing code path)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#7349