Eliminate residue?

76 views
Skip to first unread message

MetroWind

unread,
Nov 7, 2017, 2:23:39 AM11/7/17
to Beancount
Hi all,

So I have this entry:

2017-09-09 * "" "Meals"
  Expenses:Food 39.97 USD
  Expenses:Taxes:Consumer 3.7 USD
  Liabilities:Credit:Sapphire

However the context shows

2017-09-09 * "Hunan Impression" "Meals"
  Expenses:Food                 39.97 USD
  Expenses:Taxes:Consumer        3.70 USD
  Liabilities:Credit:Sapphire  -43.70 USD
Residual: (-0.03 USD)
Tolerances: USD=0.05

There are bunch of these cases, and my balance is now off by 0.05 USD (which is fine by me, but beancount always complains).  Is there a way to eliminate that without padding it?

Thanks

Oon-Ee Ng

unread,
Nov 12, 2017, 3:45:20 PM11/12/17
to bean...@googlegroups.com
Am not very familiar, but have you tried 3.70 instead of 3.7?

--
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+unsubscribe@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/4a172413-7c48-4d79-babe-08112fe09369%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

MetroWind

unread,
Nov 13, 2017, 5:12:15 PM11/13/17
to Beancount
On Sunday, November 12, 2017 at 12:45:20 PM UTC-8, Oon-Ee Ng wrote:
Am not very familiar, but have you tried 3.70 instead of 3.7?

Hmm… That’s… interesting. It works!

Thank you.
 
On 7 Nov 2017 3:23 pm, "MetroWind" <chris....@gmail.com> wrote:
Hi all,

So I have this entry:

2017-09-09 * "" "Meals"
  Expenses:Food 39.97 USD
  Expenses:Taxes:Consumer 3.7 USD
  Liabilities:Credit:Sapphire

However the context shows

2017-09-09 * "Hunan Impression" "Meals"
  Expenses:Food                 39.97 USD
  Expenses:Taxes:Consumer        3.70 USD
  Liabilities:Credit:Sapphire  -43.70 USD
Residual: (-0.03 USD)
Tolerances: USD=0.05

There are bunch of these cases, and my balance is now off by 0.05 USD (which is fine by me, but beancount always complains).  Is there a way to eliminate that without padding it?

Thanks

--
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.

Oon-Ee Ng

unread,
Nov 13, 2017, 8:50:50 PM11/13/17
to bean...@googlegroups.com
On Tue, Nov 14, 2017 at 6:12 AM, MetroWind <chris....@gmail.com> wrote:
On Sunday, November 12, 2017 at 12:45:20 PM UTC-8, Oon-Ee Ng wrote:
Am not very familiar, but have you tried 3.70 instead of 3.7?

Hmm… That’s… interesting. It works!

Thank you.

Okay... you should post a bug report for Martin to look at. This looks to be a worse impact of the way beancount automatically tries to surmise decimalization.... I've got a report on the reporting aspect of this a while back, but did not realize actual accounting would also be affected. 

Martin Blais

unread,
Nov 18, 2017, 4:56:52 PM11/18/17
to Beancount
By allowing a "3.7" amount, Beancount automatically infers that it should use a tolerance of 0.05 USD and does corresponding rounding.
In your particular example, this might not seem appealing, but there are many other scenarios - in particular, when cost basis is involved - where this is the preferential choice.
Use "3.70" in order to avoid this.

Regardless, I admit that this can be a bit surprising, and I've been pondering about adding some sort of explicit option to "fix" the tolerances, something similar to "inferred_tolerances_default", but that would simply override and set the final tolerance. It might even speed up some of the parsing.



--
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+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages