summaryrefslogtreecommitdiff
path: root/src/report.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2018-02-16 23:03:44 -0800
committerJohn Wiegley <johnw@newartisans.com>2018-02-16 23:03:44 -0800
commitfbccb7149eae348182bef7ac9dcba756fe72381d (patch)
tree742889aa83fe5da86596c46a39b7d8e448d2e610 /src/report.cc
parent7097e1a1e7ea4f4890b89ab7164e0fa10a3ca586 (diff)
downloadfork-ledger-fbccb7149eae348182bef7ac9dcba756fe72381d.tar.gz
fork-ledger-fbccb7149eae348182bef7ac9dcba756fe72381d.tar.bz2
fork-ledger-fbccb7149eae348182bef7ac9dcba756fe72381d.zip
Add (currently undocumented) function 'clear_commodity'
Diffstat (limited to 'src/report.cc')
-rw-r--r--src/report.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/report.cc b/src/report.cc
index cb7f09dc..13e6a61f 100644
--- a/src/report.cc
+++ b/src/report.cc
@@ -841,6 +841,13 @@ value_t report_t::fn_commodity(call_scope_t& args)
return string_value(args.get<amount_t>(0).commodity().symbol());
}
+value_t report_t::fn_clear_commodity(call_scope_t& args)
+{
+ amount_t amt(args.get<amount_t>(0));
+ amt.clear_commodity();
+ return amt;
+}
+
value_t report_t::fn_nail_down(call_scope_t& args)
{
value_t arg0(args[0]);
@@ -1384,6 +1391,8 @@ expr_t::ptr_op_t report_t::lookup(const symbol_t::kind_t kind,
return MAKE_FUNCTOR(report_t::fn_commodity);
else if (is_eq(p, "ceiling"))
return MAKE_FUNCTOR(report_t::fn_ceiling);
+ else if (is_eq(p, "clear_commodity"))
+ return MAKE_FUNCTOR(report_t::fn_clear_commodity);
break;
case 'd':