Ok, this is actually expected behavior. Because you used $2.899 in a
preceding transaction, Ledger now thinks that all dollar values must
be precise within 3 decimal places. Then later you have 14.32 gallons
* $3.259, which is $46.669. But your balancing amount is $46.67,
which is off by a tenth of a penny.
The answer is not to use the $2.899 in the preceding transaction,
otherwise it throws off Ledger's notion of how precise a dollar should
be. And the "D" directive does not shorten precision, it only
lengthens it, so there is no way to tell Ledger that it's OK to round
away a penny in the later transaction.
John
On Sep 20, 2009, at 8:49 PM, talisein wrote:
I git bisected my ledger file and came up with a simple test case:
C $1,000.00
Y2009
08/12 * Fuel Reimbursement
Liabilities:Friends:A ( ($2.899 * (310 / (370.5 / 14.284))) / 4 )
Assets:Fuel
; BUG BUG BUG
09/13 * Fuel
Assets:Fuel 14.320 galGas {=$3.259}
Liabilities:USAA:Mastercard $-46.67
If I replace the formula with $8.66, it works fine.