diff options
-rw-r--r-- | src/report.cc | 8 | ||||
-rw-r--r-- | src/report.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/report.cc b/src/report.cc index 4d1a9700..b866970f 100644 --- a/src/report.cc +++ b/src/report.cc @@ -207,6 +207,12 @@ value_t report_t::fn_quantity(call_scope_t& scope) return args.get<amount_t>(0).number(); } +value_t report_t::fn_floor(call_scope_t& scope) +{ + interactive_t args(scope, "v"); + return args.value_at(0).floored(); +} + value_t report_t::fn_abs(call_scope_t& scope) { interactive_t args(scope, "v"); @@ -735,6 +741,8 @@ expr_t::ptr_op_t report_t::lookup(const symbol_t::kind_t kind, case 'f': if (is_eq(p, "format_date")) return MAKE_FUNCTOR(report_t::fn_format_date); + else if (is_eq(p, "floor")) + return MAKE_FUNCTOR(report_t::fn_floor); break; case 'g': diff --git a/src/report.h b/src/report.h index 3afb0107..e27abbf9 100644 --- a/src/report.h +++ b/src/report.h @@ -143,6 +143,7 @@ public: value_t fn_rounded(call_scope_t& scope); value_t fn_unrounded(call_scope_t& scope); value_t fn_truncated(call_scope_t& scope); + value_t fn_floor(call_scope_t& scope); value_t fn_abs(call_scope_t& scope); value_t fn_justify(call_scope_t& scope); value_t fn_quoted(call_scope_t& scope); |