By the way, I'm just normal Beancount user.
I'm not a Python programmer, so I can't write scripts myself (and I clearly 
didn't have the skills to debug wrong things output by ChatGPT/Grok).

Please forgive my ignorance. This time I hope it's ok with you because now 
at least I have reproduceable examples.

On Monday, July 14, 2025 at 6:22:44 AM UTC Dan Andersson wrote:

> Hi
>
> This might related to an earlier post I made, but this time I have 
> reproduceable examples
>
> I'm on Beancount 2.3.6.
>
> Here is my test.beancount (valid Beancount file with no errors):
> ----------
> option "inferred_tolerance_default" "USD:0.000001"
>
> 2025-01-01 open Assets:Cash:USD USD
> 2025-01-01 open Assets:Cash:JPY JPY
> 2025-01-01 open Income:Consultation USD
> 2025-01-01 open Expenses:Salary USD
>
> 2025-01-01 * "income"
>   Assets:Cash:USD                      1000 USD
>   Income:Consultation                 -1000 USD
>
> 2025-01-01 * "income"
>   Assets:Cash:JPY                    147440 JPY { 0.006782419967 USD }
>   Income:Consultation                 -1000 USD
>
> 2025-01-01 * "expense"
>   Assets:Cash:JPY      -147439.999999999999 JPY { 0.006782419967 USD }
>   Expenses:Salary                      1000 USD
> ----------
>
> Running this command:
> ----------
> bean-query test.beancount \
>   "SELECT root(account, 5), sum(position) \
>   FROM OPEN ON 2025-01-01 CLOSE ON 2026-01-01 CLEAR \
>   WHERE not account ~ 'Income|Expenses' \
>   GROUP BY 1 ORDER BY 1;"
> ----------
>
> Gives this output:
> ----------
>      root_account_c5                sum_position         
> -------------------------- ------------------------------
> Assets:Cash:JPY             1E-12             JPY {0 USD}
> Assets:Cash:USD             1000              USD        
> Equity:Conversions:Current    -6.782419967E-1 USD        
> Equity:Earnings:Current    -1000              USD
> ----------
>
> *Bug 1: *Users are lead to believe the conversions are not negligible 
> (because important digits after "E" getting truncated).
>
>
> Running this command (same command as above, but with cost() added):
> ----------
> bean-query test.beancount \
>   "SELECT root(account, 5), cost(sum(position)) \
>   FROM OPEN ON 2025-01-01 CLOSE ON 2026-01-01 CLEAR \
>   WHERE not account ~ 'Income|Expenses' \
>   GROUP BY 1 ORDER BY 1;"
> ----------
> Gives this output:
> ----------
>      root_account_c5       cost_sum_
> -------------------------- ---------
> Assets:Cash:JPY                6 USD
> Assets:Cash:USD             1000 USD
> Equity:Conversions:Current    -6 USD
> Equity:Earnings:Current    -1000 USD
> ----------
>
> *Bug 2: *Users are lead to believe they own 6 USD worth of JPY, but in 
> reality they own almost nothing.
> *Bug 3: *Users are now lead to believe the conversions are -6 USD.
>
> Thanks
> DA

-- 
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 view this discussion visit 
https://groups.google.com/d/msgid/beancount/e3ebeb36-ec97-453c-be3d-5809ef8618c2n%40googlegroups.com.

Reply via email to