Round unbalanced remainders before reporting them, because that will make a

whole lot more sense to the user, rather than reporting the internal
precision.
This commit is contained in:
John Wiegley 2008-07-17 20:51:28 -04:00
parent 595452e332
commit c673b96691

View file

@ -263,6 +263,9 @@ bool entry_base_t::finalize()
error * err =
new balance_error("Entry does not balance",
new entry_context(*this, "While balancing entry:"));
DEBUG_PRINT("ledger.journal.unbalanced_remainder",
"balance = " << balance);
balance.round();
err->context.push_front
(new value_context(balance, "Unbalanced remainder is:"));
throw err;