Getting Foreign Currency amounts from transactions

Mike Bray (Quote Loader Author)'s Avatar

Mike Bray (Quote Loader Author)

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 (Mr Toolbox)'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)....

  2. Melissa closed this discussion on 29 Jan, 2021 03:05 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? 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