quentinsf / icsv2ledger

Interactive importing of CSV files to Ledger
196 stars 70 forks source link

Fix parsing of debit/credit columns that contain currency signs #83

Closed garyp closed 9 years ago

garyp commented 9 years ago

When the debit or credit options are set to a negative number, the negation logic fails if the CSV value contains non-numeric characters in it. For example, a value of "$-42.55" is incorrectly transformed into "--42.55" instead of "42.55". This is fixed by stripping non-numeric characters from numeric CSV values before the negation happens rather than after.