Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Negating amount breaks parser for negative amounts #524
Why this matters
First, it's in an example rules.
Second, currently American Express outputs amounts as “inflow” (positive) amounts in—some—CSV exports. It's a liability account, it has a credit balance, these are credits to the liability and a debit to the expense account.
A possible user solution is to flip
You're right, we don't parse a double minus sign. The CSV reader also recognises parentheses as negative, so it's better to use those for sign-flipping:
I suppose it's a good idea to change the amount parser in JournalReader.hs to allow a double minus sign. Would you be willing to give that a try ? Support available in #hledger if you need.
@simonmichael Yes, idea would be
That said, I did take a look at the CSV parsing code in the area you indicated. It seems like the possible solution would be to expand