summaryrefslogtreecommitdiff
path: root/journal.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-07-28 02:04:29 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-07-28 02:04:29 -0400
commitdede5e71bf562f43000bc88bad67688fb88f841e (patch)
tree52f79ea845380f2ed3c27147b908bdde63de531e /journal.cc
parentc93175183e790cf7f1100dfd554197161a69e6fe (diff)
downloadfork-ledger-dede5e71bf562f43000bc88bad67688fb88f841e.tar.gz
fork-ledger-dede5e71bf562f43000bc88bad67688fb88f841e.tar.bz2
fork-ledger-dede5e71bf562f43000bc88bad67688fb88f841e.zip
Corrected a bad rounding bug that affecting very small commodity entries.
Diffstat (limited to 'journal.cc')
-rw-r--r--journal.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/journal.cc b/journal.cc
index e3937b8b..638cce8b 100644
--- a/journal.cc
+++ b/journal.cc
@@ -259,13 +259,14 @@ bool entry_base_t::finalize()
}
}
+ balance.round();
+
if (balance) {
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;