Xitian9
changed the title
Compare MixedAmounts using their list of Quantities.
Compare MixedAmounts substituting 0 for missing Commodities.
Xitian9
changed the title
Compare MixedAmounts substituting 0 for missing Commodities.
Compare MixedAmounts substituting amount of quantity 0 for missing commodities.
simonmichael
changed the title
Compare MixedAmounts substituting amount of quantity 0 for missing commodities.
more useful sort order for multi-commodity MixedAmounts: treat missing commodities as 0
…ommodities. (simonmichael#1563) The basic goal of this change is to provide more predictable and intuitive behaviour when using -S/--sort-amount with multiple commodities. This is achieved by implementing a custom Ord (and Eq) instance for MixedAmount rather than relying on the derived ones. As a consequence, all the ways of representing zero with a MixedAmount ([], [A 0], [A 0, B 0, ...]) are now Eq-ual (==), whereas before they were not. We have not been able to find anything broken by this change.
Closed