Transaction does not balance with foreign currency conversion

64 views
Skip to first unread message

salmi....@gmail.com

unread,
Jun 15, 2019, 8:02:40 AM6/15/19
to Beancount
I'm trying to add a transaction about a fund I bought recently. My own currency is in euros and the fund's currency is SEK. Based on the documents from my bank I created the following transaction entry:

2019-06-12 price SEK                      0.0938 EUR
2019-06-12 * "Superruotsi osto"
  Assets:Nordnet:SuperrahastoRuotsi            1.5613 SUPERRUOTSI {375.57 SEK}
  Assets:Nordnet:Cash                             -55.00 EUR @ SEK


However, I get bean count error: 
Transaction does not balance: (-0.0000000000000000000000001 SEK)

   2019-06-13 * "Superruotsi osto"
     Assets:Nordnet:SuperrahastoRuotsi    1.5613 SUPERRUOTSI {375.57 SEK, 2019-06-13}   
     Assets:Nordnet:Cash                -55.0000 EUR @ 10.66140801818181818181818182 SEK


So looks like there is a precision problem with the exact values I have here. How I should go and fix this? 

Martin Blais

unread,
Jun 15, 2019, 8:35:36 AM6/15/19
to Beancount
Once you have  enough numbers of SEK currency in your input it'll figure it out automatically.
In the meantime, add this:

option "inferred_tolerance_default"  "SEK:0.01"




--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/63dc05b2-f5f4-422e-8e46-f0e980f672d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

salmi....@gmail.com

unread,
Jun 15, 2019, 8:46:56 AM6/15/19
to Beancount
Thanks, looks like that did the trick. 

However, what do you mean by "having enough numbers of SEK currency"? I can't add numbers to mark the price more accurately since my bank listed the currency rate and spent amount of SEKs only at the accuracy I used in the sample above.


lauantai 15. kesäkuuta 2019 15.35.36 UTC+3 Martin Blais kirjoitti:
Once you have  enough numbers of SEK currency in your input it'll figure it out automatically.
In the meantime, add this:

option "inferred_tolerance_default"  "SEK:0.01"




On Sat, Jun 15, 2019 at 8:02 AM <salmi...@gmail.com> wrote:
I'm trying to add a transaction about a fund I bought recently. My own currency is in euros and the fund's currency is SEK. Based on the documents from my bank I created the following transaction entry:

2019-06-12 price SEK                      0.0938 EUR
2019-06-12 * "Superruotsi osto"
  Assets:Nordnet:SuperrahastoRuotsi            1.5613 SUPERRUOTSI {375.57 SEK}
  Assets:Nordnet:Cash                             -55.00 EUR @ SEK


However, I get bean count error: 
Transaction does not balance: (-0.0000000000000000000000001 SEK)

   2019-06-13 * "Superruotsi osto"
     Assets:Nordnet:SuperrahastoRuotsi    1.5613 SUPERRUOTSI {375.57 SEK, 2019-06-13}   
     Assets:Nordnet:Cash                -55.0000 EUR @ 10.66140801818181818181818182 SEK


So looks like there is a precision problem with the exact values I have here. How I should go and fix this? 

--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bean...@googlegroups.com.

Martin Blais

unread,
Jun 15, 2019, 9:02:50 AM6/15/19
to Beancount
It's complicated, see some history on the list for some context, Beancount is trying to figure it out itself.
The bottom line is that I want to add an option so you can just set the value and avoid inference.
Have to run,



To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.

To post to this group, send email to bean...@googlegroups.com.

salmi....@gmail.com

unread,
Jun 15, 2019, 9:04:48 AM6/15/19
to Beancount
Ah alright, that kind of an options sounds like a good addition since I have had similar balancing problems occasionally (but in the end managed to fiddle with numbers just enough to fix them).
Reply all
Reply to author
Forward
0 new messages