diff options
author | John Wiegley <johnw@newartisans.com> | 2009-01-30 19:27:55 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-01-30 19:27:55 -0400 |
commit | 040255a52b48251dc54bd18e37acc58f858f287a (patch) | |
tree | 0769808f0ef9377a728c0e5f1c8910327832bff4 | |
parent | 3dbdeb2917eba0145b6f4c967ebda230cd8ace59 (diff) | |
download | fork-ledger-040255a52b48251dc54bd18e37acc58f858f287a.tar.gz fork-ledger-040255a52b48251dc54bd18e37acc58f858f287a.tar.bz2 fork-ledger-040255a52b48251dc54bd18e37acc58f858f287a.zip |
There is no need to round a balance before calling is_zero().
-rw-r--r-- | src/entry.cc | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/entry.cc b/src/entry.cc index 8a4f851f..6a85bacd 100644 --- a/src/entry.cc +++ b/src/entry.cc @@ -226,16 +226,13 @@ bool entry_base_t::finalize() DEBUG("entry.finalize", "final balance = " << balance); - if (! balance.is_null()) { - balance.in_place_round(); - if (! balance.is_zero()) { + if (! balance.is_null() && ! balance.is_zero()) { #if 0 - new entry_context(*this, "While balancing entry:"); + new entry_context(*this, "While balancing entry:"); #endif - add_error_context("Unbalanced remainder is: "); - add_error_context(value_context(balance)); - throw_(balance_error, "Entry does not balance"); - } + add_error_context("Unbalanced remainder is: "); + add_error_context(value_context(balance)); + throw_(balance_error, "Entry does not balance"); } // Add the final calculated totals each to their related account |