On 2026-05-10, John Wiegley wrote:
>>>>>> "TO" == Tavis Ormandy <[email protected]> writes:
>
>> I'm not really sure of the benefit, but the obvious problem is that people
>> with lots and lots of commodity trades might notice balances drift after
>> they upgrade. Today, even with the most complex ledger if you do something
>> like `ledger --cost -X USD bal` the total should be no more than +/- 1 cent
>> (from the final rounding for display...right?).
>
> I definitely do not want commodity drift, so I’m going to dig into this change
> in behavior more deeply.
>
> John
>

Oh, okay, thanks, I guess I didn't think it was a bug just a major
change :)

I guess a minimum testcase would be some transaction that needs
rounding, e.g.

2025/01/01 * Opening Balances
    Assets:Brokerage     $123.45
    Equity:Opening Balances
2025/02/01 * Investment
    Assets:Brokerage    0.005 FOO @ $124.95
    Assets:Brokerage    0.001 BAR @ $124.95
    Assets:Brokerage

with main you get:

$ ledger --cost -X USD bal
             $123.44  Assets:Brokerage
            $-123.45  Equity:Opening Balances
--------------------
              $-0.01

But every rounded transaction can add a penny, so if I duplicate it
three times...

2025/01/01 * Opening Balances
    Assets:Brokerage     $123.45
    Equity:Opening Balances
2025/02/01 * Investment
    Assets:Brokerage    0.005 FOO @ $124.95
    Assets:Brokerage    0.001 BAR @ $124.95
    Assets:Brokerage
2025/02/01 * Investment
    Assets:Brokerage    0.005 FOO @ $124.95
    Assets:Brokerage    0.001 BAR @ $124.95
    Assets:Brokerage
2025/02/01 * Investment
    Assets:Brokerage    0.005 FOO @ $124.95
    Assets:Brokerage    0.001 BAR @ $124.95
    Assets:Brokerage

$ ledger --cost -X USD bal
             $123.42  Assets:Brokerage
            $-123.45  Equity:Opening Balances
--------------------
              $-0.03

In the current release, I think it would be zero, because rounding only
happens once.

Tavis.

-- 
 _o)            $ lynx lock.cmpxchg8b.com
 /\\  _o)  _o)  $ finger [email protected]
_\_V _( ) _( )  @taviso

-- 

--- 
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].
To view this discussion visit 
https://groups.google.com/d/msgid/ledger-cli/10tqpdg%24fmr%241%40ciao.gmane.io.

Reply via email to