TheAxelander / OpenBudgeteer

OpenBudgeteer is a budgeting app based on the Bucket Budgeting Principle
https://theaxelander.github.io
MIT License
788 stars 43 forks source link

Fixed not importing csvs with amounts with £ in them. #83

Closed Hazy87 closed 2 years ago

Hazy87 commented 2 years ago

Switched to using decimal.TryParse which should nicely remove any currency from the string. Fixes #83

TheAxelander commented 2 years ago

Thanks a lot for the contribution. I think tomorrow I will have a look into this.

TheAxelander commented 2 years ago

Looking good. The missing piece was the NumberStyles.Currency which I could simply add to the DecimalConverter in line 67. I will nevertheless take over your implementation.

To give some background: The TinyCsvParser package has custom Converter implemented, that's the reason why I used the DecimalConverter class. Surprisingly after checking the code of DecimalConverter it's also just doing a decimal.TryParse without any further special things. Hence I take over your approach which I more prefer.