Getting Foreign Currency amounts from transactions

Mike Bray 's Avatar

Mike Bray

23 Sep, 2020 01:39 PM

If I understand it correctly you can only enter a foreign currency value into a transaction if the category of the transaction has been declared with that Foreign Currency. That means the parent Txn's value is returned by the getValue() method of AbstractTxn. I am assuming that getValue() on the split will return the Foreign Currency amount. Is there a call to get the Rate used? Or do I have to calculate it?

  1. 1 Posted by Stuart Beesley ... on 30 Nov, 2020 07:39 AM

    Stuart Beesley - JUST A FELLOW USER's Avatar

    From memory, on investments, I had to use:

    from the record, get the account, get the currency
    1.0 / curr.getRelativeRate() gives the same as the currency screen
    y * curr .getRate(None) to get current price. I assume the same for currency rather than stocks (the API doesn't say you can use None)....

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac