giacomos/qifparse

Commas in large numbers break parsing

Opened this issue · 2 comments

rtaft commented

A quicken 2016 export with transactions greater than 1000 will export it as 1,000. Parsing throws an exception when encountering this.

The same issue with kmymoney QIF export - large numbers have commas and this breaks the parser.

I'm having the same problem.
I wonder if it is a locale-dependent stuff or if we can make a function like this

Since it should be the standard format of qif ii think we could just use a function like this

def cleanNumber(stringa):
    s=stringa.replace(',','')
    try:
        float(s)
        return s
    except ValueError:
        raise ValueError('Wrong currency format')

in parser.py to sanitize the input.

I did this fix and some others in my branch.
Now it works for the qifs generated from my bank.
~~I'll do some other testing and then i'll submit a merge request ~~

https://github.com/VincenzoLaSpesa/qifparse

the pull request is here

#24