From 8214a69e20aa6d5ef2dbb86ca670a02b013db0f1 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Tue, 6 Nov 2012 11:56:43 +0000 Subject: fix comment in display_filter_posts::output_rounding(post_t) slightly more detail in the case of zero display_amount and --empty not specified. --- src/filters.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/filters.cc b/src/filters.cc index f5694133..5e2bf983 100644 --- a/src/filters.cc +++ b/src/filters.cc @@ -530,9 +530,11 @@ bool display_filter_posts::output_rounding(post_t& post) } // Allow the posting to be displayed if: - // 1. It's display_amount would display as non-zero - // 2. The --empty option was specified - // 3. The account of the posting is + // 1. Its display_amount would display as non-zero, or + // 2. The --empty option was specified, or + // 3. a) The account of the posting is , and + // b) the revalued option is specified, and + // c) the --no-rounding option is not specified. if (post.account == revalued_account) { if (show_rounding) -- cgit v1.2.3 From a6d40ada1f33ebce5ed55ddd2d54a187a1f70c59 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Tue, 6 Nov 2012 12:01:16 +0000 Subject: right-justify amount_expr text in print report where possible --- src/print.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/print.cc b/src/print.cc index 79d83161..a4a0bc6f 100644 --- a/src/print.cc +++ b/src/print.cc @@ -203,9 +203,15 @@ namespace { (static_cast(account_width) - static_cast(name.length())); + std::size_t amount_width = + (report.HANDLED(amount_width_) ? + lexical_cast(report.HANDLER(amount_width_).str()) : + 12); string amt; if (post->amount_expr) { - amt = post->amount_expr->text(); + std::ostringstream amt_str; + justify(amt_str, post->amount_expr->text(), amount_width, true); + amt = amt_str.str(); } else if (count == 2 && index == 2 && post_has_simple_amount(*post) && @@ -218,11 +224,6 @@ namespace { // first. } else { - std::size_t amount_width = - (report.HANDLED(amount_width_) ? - lexical_cast(report.HANDLER(amount_width_).str()) : - 12); - std::ostringstream amt_str; value_t(post->amount).print(amt_str, static_cast(amount_width), -1, AMOUNT_PRINT_RIGHT_JUSTIFY | -- cgit v1.2.3