summaryrefslogtreecommitdiff
path: root/src/report.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/report.cc')
-rw-r--r--src/report.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/report.cc b/src/report.cc
index 28836d0f..21fc9c1b 100644
--- a/src/report.cc
+++ b/src/report.cc
@@ -813,10 +813,12 @@ value_t report_t::fn_nail_down(call_scope_t& args)
switch (arg0.type()) {
case value_t::AMOUNT: {
amount_t tmp(arg0.as_amount());
- if (tmp.has_commodity() && ! arg1.is_null()) {
+ if (tmp.has_commodity() && ! tmp.is_null() && ! tmp.is_realzero()) {
+ arg1 = arg1.strip_annotations(keep_details_t()).to_amount();
expr_t value_expr(is_expr(arg1) ?
as_expr(arg1) :
- expr_t::op_t::wrap_value(arg1.unrounded() / arg0));
+ expr_t::op_t::wrap_value(arg1.unrounded() /
+ arg0.number()));
std::ostringstream buf;
value_expr.print(buf);
value_expr.set_text(buf.str());