Thanks Martin, for filing the bug! The workaround is totally fine for now, if that helps with prioritizing.
There is a related question I have. Even if I use 331.00 USD for the Liabilities posting, the sum of the Expenses posting would add up to (and render as) 330.9999999999999999999999997 USD. Although this is computationally "correct" given what I asked for (331/12), is there a better way to perhaps render it (on the web or in bean-query) just so it appears prettier? This too is a pretty minor issue - just something for the long term work, perhaps. On Wednesday, June 10, 2015 at 11:34:34 AM UTC-7, Martin Blais wrote: > > Oh <poop> indeed, that looks like a bug. > What's happening is that division will be processed by the parser and > produce the full 28 decimal digits of precision, and that it used as input > for tolerance inference (and it shouldn't be IMO) and then because your > other amount is an integer (331) it doesn't contribute to the tolerance > inference. I need to find a solution for this, probably disable inference > from computed numbers... this is a case where the per-transaction tolerance > inference fails - congratulations you've found a bug. > > In the meantime, changing your first amount from -331 SUD to -331.00 USD > should do the trick, because it'll expand the tolerance on USD to 0.005 and > that's enough > > Tracking bug: > > https://bitbucket.org/blais/beancount/issue/56/figure-out-how-to-disable-tolerance > > > > > On Wed, Jun 10, 2015 at 12:03 PM, <[email protected] <javascript:>> > wrote: > >> I'm not sure I understand how the divide operator interacts with the >> recent tolerance changes, if it does. For example, if I do this: >> >> -------------------------------------------------------- >> option "title" "Main accounts" >> option "operating_currency" "USD" >> >> 1999-01-01 open Liabilities:Credit-Card >> 1999-01-01 open Expenses:Utility-Bill >> >> 2000-01-01 * "Power company" >> Liabilities:Credit-Card -331 USD >> Expenses:Utility-Bill 331/12 USD >> Expenses:Utility-Bill 331/12 USD >> Expenses:Utility-Bill 331/12 USD >> Expenses:Utility-Bill 331/12 USD >> Expenses:Utility-Bill 331/12 USD >> Expenses:Utility-Bill 331/12 USD >> Expenses:Utility-Bill 331/12 USD >> Expenses:Utility-Bill 331/12 USD >> Expenses:Utility-Bill 331/12 USD >> Expenses:Utility-Bill 331/12 USD >> Expenses:Utility-Bill 331/12 USD >> Expenses:Utility-Bill 331/12 USD >> -------------------------------------------------------- >> I get: bean-check output: >> divide.bc:7: Transaction does not balance: (-2.8E-25 USD) >> >> Is there a recommended way to handle such situations without having to >> add an explicit rounding error posting? >> >> -- >> 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] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/beancount/a1b520d1-1039-43d2-8054-58411e5e1e9e%40googlegroups.com >> >> <https://groups.google.com/d/msgid/beancount/a1b520d1-1039-43d2-8054-58411e5e1e9e%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > -- --- You received this message because you are subscribed to the Google Groups "Ledger" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
