hledger should balance by displayed precision, not actual amounts #23

Closed
simonmichael opened this Issue Apr 8, 2013 · 1 comment

Projects

None yet

1 participant

@simonmichael
Owner

Original author: simon@joyful.com (August 13, 2010 01:13:42)

Thierry Daucourt reported a case where hledger fails to balance a transaction that ledger allows. Eg:

2010/1/1 x
A 55.3653 C @ 30.92189512 D
A -1712 D

hledger compares the actual amounts. ledger compares the displayed strings, and the display precision is zero decimal places, since ledger does not consider the precision of prices. We should be more like ledger here.

Original issue: http://code.google.com/p/hledger/issues/detail?id=23

@simonmichael
Owner

From simon@joyful.com on November 14, 2010 22:54:09
Fixed. We now behave like ledger here:

Like ledger, price amounts are now "unobserved", ie their precision does
not affect the canonical display precisions used when displaying amounts,
and transaction balancing is done based on display precision, ie amounts
are considered to balance if their sum appears to be zero when using the
canonical display precision.

This should work better for people working with commodity prices. Thierry also asked for implicit price (calculated from two amounts) and explicit total cost (specified with @@) support, folks needing that should feel free to open and upvote a separate wishlist issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment