portfolio-performance / portfolio

Track and evaluate the performance of your investment portfolio across stocks, cryptocurrencies, and other assets.
http://www.portfolio-performance.info
Eclipse Public License 1.0
2.91k stars 599 forks source link

Exchange rates with more than 3 digits after the decimal point are imported with loss in CSV Import and break it #1830

Open lukaszp opened 3 years ago

lukaszp commented 3 years ago

Exchange rates with more than 3 digits after the decimal point are imported with loss in CSV Import. It causes DeGiro CSV files to not import due to calculation-data discrepancy. It is likely due to too short DecimalFormat string "#,##0.###" in this line: https://github.com/buchen/portfolio/blob/d5ae1b5f7c99e7cd458e1fcba5fc7496bf7e4ce5/name.abuchen.portfolio/src/name/abuchen/portfolio/datatransfer/csv/CSVImporter.java#L350

It should be "#,##0.####". Exchange rates have usually more than 3 digits after the decimal point.

buchen commented 3 years ago

Exchange rates with more than 3 digits after the decimal point are imported with loss in CSV Import. It causes DeGiro CSV files to not import due to calculation-data discrepancy.

Can you share one line of the DeGiro CSV import?

I have just tested it with some manual CSV import. The exchange rate is parsed as BigDecimal and keeps regardless how many hashtags (#) are in the pattern