On Tue, Oct 11, 2016 at 3:48 AM, Saša Janiška <[email protected]> wrote:

> Martin Blais <[email protected]> writes:
>
> > Could you share one example that would generate these errors?
> > I'm curious.
>
>
> Practically, all the transactions in regard to money exchange between
> EUR and HRK, e.g.
>
> 2013-01-21 * "money exchange"
>   Assets:Gotovina:HRK                3004 HRK @ 0.13315579227696404794 EUR
>   Assets:Gotovina:EUR                -400 EUR
>
> which generates: Transaction does not balance: (1.176E-17 EUR)
>
> and solution was simple:
>
> 2013-01-21 * "money exchange"
>   Assets:Gotovina:HRK                3004 HRK
>   Assets:Gotovina:EUR                -400 EUR @ 7.51 HRK
>

That's one way to solve it, but there's a better way.
Rounding it manually like this will be time-consuming, probably.

The problem here is that because you haven't used digits on "400", the
tolerance for balancing EUR currencies in this transaction is 0, meaning it
has to match perfectly. With such a rate this is virtually impossible.

Try making 400 -> 400.00 instead, and now the inferred tolerance will be
0.005 EUR, and it will work. I also don't suggest this method, because it
will be manual - just putting it out there to illustrate how the tolerances
are inferred from the digits that are presented in the file.

Now, a much better solution would be to tell Beancount what tolerance to
use when none can be inferred, like here. You would do this once, at the
top of your file, with this option:

option "inferred_tolerance_default" "EUR:0.005"

That should probably be enough.
You could do this for all the currencies you have which aren't using digits
very often.

If you'd like to learn more about how tolerances are inferred automatically
and how defaults are handled, you can read this document:
http://furius.ca/beancount/doc/tolerances

I hope this helps,

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/CAK21%2BhNSbuCg9UyNWyD0k6fCu5EVeZ_wPWrudq_Vk21zywsGrw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to