aniav / ynab-csv

Tool for making your CSV files ready to import into YNAB
https://aniav.github.io/ynab-csv/
MIT License
162 stars 85 forks source link

Ability to choose comma or point as decimal separator. #2

Closed pminnebach closed 6 years ago

pminnebach commented 6 years ago

In Belgium we use the comma as a decimal separator. But afaics your tool uses the point, which is probably the default in the US.

Thus making a -2,40 in my .csv a -240 transaction, which is not correct in my case.

aniav commented 6 years ago

Thanks for the report. It seems the separator is different in European countries as well, as I am using the tool in Poland. I will try to add that change in the following weeks. But please don't hesitate to nudge me if I won't act in, let's say, 3 weeks 🙏 👀

pminnebach commented 6 years ago

Oh, and my stupid bank also uses CRLF. 👎 But i haven't tested yet if the tool handles that correctly.

jdambacher commented 6 years ago

@aniav Do you have any update? I've already did some research by myself:

This line does the magic: https://github.com/aniav/ynab-csv/blob/8db79f9ee1f4e35ba19f8a9e36d170dd141b5ea3/src/data_object.js#L68

Possible solution: Documentation of accounting.js says the following:

If a non-standard decimal separator was used (eg. a comma) unformat() will need it in order to work out which part of the number is a decimal/float accounting.unformat("€ 1.000.000,00", ",");

We could use this, but then we have to find a solution for points as decimal separators. Any ideas? Search and replace? Individual setting by user?

aniav commented 6 years ago

I decided to remove number parsing at all because YNAB gives us the ability to choose the number format (which is then gracefully accepted in file imports). Can you check if it's better now?

jdambacher commented 6 years ago

@aniav Looks cool. But http://aniav.github.io/ynab-csv is still on the old version, isn't it?

aniav commented 6 years ago

@jdambacher all is in the new version, each push auto-updates the page.

jdambacher commented 6 years ago

@aniav Thank you! I tested it yesterday and it worked with about 165 transactions. I think this issue can be closed now.