summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-07-17 20:51:28 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-07-17 20:55:15 -0400
commitc673b9669106412d75912124d16db5c975bb60bf (patch)
tree5430679fcc5fb4f69615bb061af9f5ca28106aa7
parent595452e332f338c27a3d7befb75f1b39e5a4f9a7 (diff)
downloadfork-ledger-c673b9669106412d75912124d16db5c975bb60bf.tar.gz
fork-ledger-c673b9669106412d75912124d16db5c975bb60bf.tar.bz2
fork-ledger-c673b9669106412d75912124d16db5c975bb60bf.zip
Round unbalanced remainders before reporting them, because that will make a
whole lot more sense to the user, rather than reporting the internal precision.
-rw-r--r--journal.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/journal.cc b/journal.cc
index 4b3da90c..e3937b8b 100644
--- a/journal.cc
+++ b/journal.cc
@@ -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;