diff options
Diffstat (limited to 'src/report.cc')
-rw-r--r-- | src/report.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/report.cc b/src/report.cc index 360b7685..42a9b186 100644 --- a/src/report.cc +++ b/src/report.cc @@ -363,6 +363,21 @@ value_t report_t::get_total_expr(call_scope_t& scope) return total_expr.calc(scope); } +namespace { + value_t print_balance(call_scope_t& args) + { + var_t<long> first_width(args, 1); + var_t<long> latter_width(args, 2); +#if 0 + var_t<bool> bold_negative(args, 3); +#endif + + std::ostringstream out; + args[0].dump(out, *first_width, *latter_width); + return string_value(out.str()); + } +} + expr_t::ptr_op_t report_t::lookup(const string& name) { const char * p = name.c_str(); @@ -423,6 +438,11 @@ expr_t::ptr_op_t report_t::lookup(const string& name) } } break; + + case 'p': + if (name == "print_balance") + return WRAP_FUNCTOR(print_balance); + break; } return session.lookup(name); |