Skip to content

[CSV] Import does not work due to rounding errors on exchange rates #5069

@wouter-in2facts

Description

@wouter-in2facts

Describe the bug
The gross amount is rounded to 2 decimals, creating rounding errors during the validation.
Example during a dividend transaction, see attachment.

Relevant data:
Value = 95.26
FX Rate = 1.3795
Those are the only 2 inputs.
The Gross Amount is calculated (in a separate processor preparing the csv for PP) by dividing the Value by the FX Rate, which equals to 69.0540050743023.
However the application only sees "69.05". 69.05 * 1.3795 = 95.254475.
Which is why the application says:
Imported gross value (CAD 95.25) and calculated gross value (CAD 95.26) do not match: Jun 20, 2025 Dividend CAD 95.26 iShares MSCI Emerging Markets Min Vol Factor ETF

Note that the Value (95.26) is correct, that is what the account is using.
If the gross amount was also at least 4 decimals, this would not be an issue:
69.0540 * 1.3795 = 95.259993 which would round to 95.26 which would be accepted

example.csv

To Reproduce
Steps to reproduce the behavior:

  1. Create a CSV-file with the following data (see attachment).
    Note: the number of shares is left blank. This is due to the original source (extract from wealthsimple) not giving this information
  2. Import CSV
  3. An error will occur stating
    Imported gross value (CAD 95.25) and calculated gross value (CAD 95.26) do not match: Jun 20, 2025 Dividend CAD 95.26 iShares MSCI Emerging Markets Min Vol Factor ETF

Expected behavior
The transaction should be accepted if the number of decimals of the gross amount was 4 or more

Screenshots

Image

Desktop (please complete the following information):

  • OS: win32, x86_64
  • Version 0.80.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions