[GH-ISSUE #7121] [Bug]: Transaction Amount Parser Fails on Trailing Whitespace #52104

Closed
opened 2026-04-30 20:16:36 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @frameperfec on GitHub (Mar 4, 2026).
Original GitHub issue: https://github.com/actualbudget/actual/issues/7121

What happened?

The CSV import engine fails to correctly parse transaction amounts that include trailing whitespace (e.g., "$3,000 "). Trailing whitespaces are frequently introduced when a CSV is opened and saved in Microsoft Excel. The resulting error varies based on the string format:

Input String Amout Imported
"$1,055" $1,055.00
"$1,055 " $1.06
"$1,055.00 " $105,500.00

This suggests the parser's regex or string-to-float logic fails to trim the input before processing.

How can we reproduce the issue?

  1. Obtain a CSV where values in the "Amount" column are represented as strings and contain a space after the last digit
  2. Upload the file to the Actual Budget import interface
  3. Observe the resulting transaction in the ledger

debug transactions.csv

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

Brave

Operating System

UGOS Linux (host), Windows 10 (web client)

Originally created by @frameperfec on GitHub (Mar 4, 2026). Original GitHub issue: https://github.com/actualbudget/actual/issues/7121 ### What happened? The CSV import engine fails to correctly parse transaction amounts that include trailing whitespace (e.g., "$3,000 "). Trailing whitespaces are frequently introduced when a CSV is opened and saved in Microsoft Excel. The resulting error varies based on the string format: | Input String | Amout Imported | | :--- | :--- | | `"$1,055"` | `$1,055.00` | | `"$1,055 "` | `$1.06` | | `"$1,055.00 "` | `$105,500.00` | This suggests the parser's regex or string-to-float logic fails to trim the input before processing. ### How can we reproduce the issue? 1. Obtain a CSV where values in the "Amount" column are represented as strings and contain a space after the last digit 2. Upload the file to the Actual Budget import interface 3. Observe the resulting transaction in the ledger [debug transactions.csv](https://github.com/user-attachments/files/25738146/debug.transactions.csv) ### Where are you hosting Actual? Docker ### What browsers are you seeing the problem on? Brave ### Operating System UGOS Linux (host), Windows 10 (web client)
GiteaMirror added the transaction importgood first issuebug labels 2026-04-30 20:16:36 -05:00
Author
Owner

@augustdjang commented on GitHub (Mar 7, 2026):

I'd like to work on this. The fix should be straightforward — trimming the input string before parsing. I'll submit a PR shortly.

<!-- gh-comment-id:4015990765 --> @augustdjang commented on GitHub (Mar 7, 2026): I'd like to work on this. The fix should be straightforward — trimming the input string before parsing. I'll submit a PR shortly.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#52104