I've implemented a new option for the display precision:
https://github.com/beancount/beancount/commit/89a0e48df40f7c95c7ec29f2f6028a5b3d16212b
https://github.com/beancount/beancount/commit/9e148b76216982ec938d84726f12dab48b3a2444

[image: image.png]

I vibecoded the tests.
(I should do one for tolerance as well)






On Thu, May 22, 2025 at 11:21 AM Martin Blais <[email protected]> wrote:

> bean-report is deprecated.
> AFAIR its precision was a distinct implementation from beanquery.
> Use beanquery.
>
> Use 3.0 instead of 3 you should be alright.
> Long term fix is to add an option to fix the precision form explicit
> declarations.
>
>
>
> On Wed, May 21, 2025 at 8:51 AM Dan Andersson <[email protected]>
> wrote:
>
>> Version 2.3.6. Running bean-report file.beancount balances on this:
>>
>> ---
>> 2022-12-05 open Assets:Stock
>> 2022-12-05 open Assets:Cash
>>
>> 2022-12-05 * ""
>>   Assets:Stock     3 STOCK { 50 USD }
>>   Assets:Cash   -150 USD
>>
>> 2022-12-06 * ""
>>   Assets:Stock    -3 STOCK { 50 USD }
>>   Assets:Cash    150 USD
>>
>> ; Buy 0.5 shares (broker supports fractional shares).
>> 2022-12-07 * ""
>>   Assets:Stock   0.5 STOCK { 60 USD }
>>   Assets:Cash    -30 USD
>> ---
>>
>> gives an unexpected result:
>>
>> ---
>> Assets:Cash     -30 USD
>> Assets:Stock      0 STOCK
>> ---
>>
>> (Shouldn't the user be able to confidently specify 0.5 STOCK, without
>> worrying that Beancount will just ignore it only because prior events had
>> less precision?)
>>
>> BTW, commenting out the middle directive:
>>
>> ---
>> 2022-12-05 open Assets:Stock
>> 2022-12-05 open Assets:Cash
>>
>> 2022-12-05 * ""
>>   Assets:Stock     3 STOCK { 50 USD }
>>   Assets:Cash   -150 USD
>>
>> ; 2022-12-06 * ""
>> ;   Assets:Stock    -3 STOCK { 50 USD }
>> ;   Assets:Cash    150 USD
>>
>> ; Buy 0.5 shares (broker supports fractional shares).
>> 2022-12-07 * ""
>>   Assets:Stock   0.5 STOCK { 60 USD }
>>   Assets:Cash    -30 USD
>> ---
>>
>> and the 0.5 STOCK is no longer ignored:
>>
>> ---
>> Assets:Cash    -180   USD
>> Assets:Stock      3.5 STOCK
>> ---
>>
>> --
>> 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/7c891999-aad1-4c73-a134-704f615a2a4en%40googlegroups.com
>> <https://groups.google.com/d/msgid/beancount/7c891999-aad1-4c73-a134-704f615a2a4en%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/CAK21%2BhMx2nV0KLKodwstVQSJwmSGLpQy-24xUbrvOvVZ7mtvqg%40mail.gmail.com.

Reply via email to