summaryrefslogtreecommitdiff
path: root/src/filters.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-01-30 19:30:16 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-01-30 19:30:16 -0400
commite0dd2cd0a44ddbfabadb30da4569e10fd36960a9 (patch)
tree74e691cce67fbc1e975c918d2acb34733b1fd857 /src/filters.cc
parent6213dc5af8b365cde2495fddaa465b0427779d00 (diff)
downloadledger-e0dd2cd0a44ddbfabadb30da4569e10fd36960a9.tar.gz
ledger-e0dd2cd0a44ddbfabadb30da4569e10fd36960a9.tar.bz2
ledger-e0dd2cd0a44ddbfabadb30da4569e10fd36960a9.zip
Changed to using rational numbers instead of integer approximations.
As a result, dependency on the gdtoa was dropped, and dependency on mpfr was added.
Diffstat (limited to 'src/filters.cc')
-rw-r--r--src/filters.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/filters.cc b/src/filters.cc
index bfa85a42..47dec09b 100644
--- a/src/filters.cc
+++ b/src/filters.cc
@@ -367,7 +367,11 @@ void changed_value_xacts::output_diff(const date_t& date)
value_t cur_bal;
last_xact->xdata().date = date;
+#ifdef INTEGER_MATH
cur_bal = total_expr.calc(*last_xact).round();
+#else
+ cur_bal = total_expr.calc(*last_xact);
+#endif
if (value_t diff = cur_bal - last_balance) {
entry_temps.push_back(entry_t());
@@ -390,7 +394,11 @@ void changed_value_xacts::operator()(xact_t& xact)
item_handler<xact_t>::operator()(xact);
+#ifdef INTEGER_MATH
last_balance = total_expr.calc(xact).round();
+#else
+ last_balance = total_expr.calc(xact);
+#endif
last_xact = &xact;
}