summaryrefslogtreecommitdiff
path: root/src/report.cc
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2012-10-25 22:28:26 -0700
committerCraig Earls <enderw88@gmail.com>2012-10-25 22:28:26 -0700
commitb044a74bd34afdc27baf6241fe398690ff5e043a (patch)
tree6cf2168e51611a86e04d834b2a507322a8a8fe04 /src/report.cc
parent4b261f99bc56853b3468a8a1bb5b4af39ed67af5 (diff)
downloadfork-ledger-b044a74bd34afdc27baf6241fe398690ff5e043a.tar.gz
fork-ledger-b044a74bd34afdc27baf6241fe398690ff5e043a.tar.bz2
fork-ledger-b044a74bd34afdc27baf6241fe398690ff5e043a.zip
Bug 634 and 488, Corrected behavior of floor, and added ceiling
This is only a partial fix for 634, since rounding is not fixed.
Diffstat (limited to 'src/report.cc')
-rw-r--r--src/report.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/report.cc b/src/report.cc
index 662386a4..dc5a0704 100644
--- a/src/report.cc
+++ b/src/report.cc
@@ -681,6 +681,11 @@ value_t report_t::fn_floor(call_scope_t& args)
return args[0].floored();
}
+value_t report_t::fn_ceiling(call_scope_t& args)
+{
+ return args[0].ceilinged();
+}
+
value_t report_t::fn_round(call_scope_t& args)
{
return args[0].rounded();
@@ -1335,6 +1340,8 @@ expr_t::ptr_op_t report_t::lookup(const symbol_t::kind_t kind,
return WRAP_FUNCTOR(fn_cyan);
else if (is_eq(p, "commodity"))
return MAKE_FUNCTOR(report_t::fn_commodity);
+ else if (is_eq(p, "ceiling"))
+ return MAKE_FUNCTOR(report_t::fn_ceiling);
break;
case 'd':