Ok, I guess it's not a bug in the conversions themselves like you say. (You 
wrote the code so you have (given how all else balances 100%) good reasons 
to say this... I trust you)

However then it must be a *display bug/issue* in bean-query. Because in the 
meantime I have already come across numbers from those queries ending with 
stuff like "...E USD" and "...E- USD". So it can get truncated that way - 
important info cut out.

Until this get fixed, can you please suggest some hack I can use to 
increase the display precision in bean-query? Is there some Python file on 
my Linux system I can modify? (It seems to be a standard beancount 
installation with bin, lib directories and the python files inside lib)


On Monday, May 26, 2025 at 6:32:48 PM UTC [email protected] wrote:

> Hmm, bean-query is probably rounding for display, so that doesn't prove 
> much.
>
> Here's how you can truly validate that there's a bug:
> If you simply sum up all the positions in a single Inventory object in a 
> script it should be empty. 
> If it's not empty, there's a bug.
>
>
>
>
> On Mon, May 26, 2025 at 3:43 AM Dan Andersson <[email protected]> 
> wrote:
>
>> Unless you can demonstrate that there is a bug I have to assume it's a 
>> case of misunderstanding how the conversion entry gets generated.
>>
>>
>> I was able to replicate the bug elsewhere. I can't share whole file 
>> because info might be sensitive, but I can now show you how I reproduce the 
>> problem:
>>
>> Running:
>>
>> bean-query debug.beancount \
>>     "SELECT root(account, 2), cost(sum(position)) \
>>     FROM OPEN ON 2022-08-01 CLOSE ON 2024-01-01 CLEAR \
>>     WHERE not account ~ 'Income|Expenses' \
>>     GROUP BY 1 ORDER BY 1;" | grep '[^ ]$'
>>
>> gives me this:
>>
>> Assets:SomeAsset1           9.28888 USD
>> Assets:SomeAsset2         -29.78513 USD
>> Assets:SomeAsset3       -5500.81881 USD
>> Assets:SomeAsset4        5232.10755 USD
>> Equity:Conversions         -9.35870 USD
>> Equity:Earnings           290.93981 USD
>> Liabilities:Liability1     -1.73230 USD
>>
>> As you can see (after summing up the numbers), "Equity:Conversions" is 
>> bogus (because without it, things already add up to 0).
>>
>> This is the last line in debug.beancount:
>>
>> 2023-01-03 * ""
>>   Liabilities:Liabilities:FooLiability    1.1300 EUR    { 0.93638 USD }
>>   Income:Income3    -0.0005763 USD
>>   Assets:SomeAsset3    -1.129999999999999 EUR    { 0.93587 USD }
>>
>> If I modify it to this:
>>
>> 2023-01-03 * ""
>>   Liabilities:Liabilities:FooLiability    1.1300 EUR    { 0.93638 USD }
>>   Income:Income3    -0.0005763 USD
>>   Assets:SomeAsset3    -1.13 EUR    { 0.93587 USD }
>>
>> I now get the expected balances (i.e. bogus conversions is gone):
>>
>> Assets:SomeAsset1           9.28888 USD
>> Assets:SomeAsset2         -29.78513 USD
>> Assets:SomeAsset3       -5500.81881 USD
>> Assets:SomeAsset4        5232.10755 USD
>> Equity:Earnings           290.93981 USD
>> Liabilities:Liability1     -1.73230 USD
>>
>> So just some precision stuff causes bogus -9.35870 USD conversions 
>> popping up out of nowhere.
>>
>> Although I can't share the whole file, you can let me know if you want me 
>> to e.g. insert print/echo statements in some python files to extract more 
>> info (to pinpoint the issue).
>>  
>>
>> -- 
>>
> 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/5f7308f8-7133-40a1-a8d8-64a7c66c9dd7n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/beancount/5f7308f8-7133-40a1-a8d8-64a7c66c9dd7n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/27e1a493-34c5-4329-b946-e4691b7779adn%40googlegroups.com.

Reply via email to