diff options
author | Craig Earls <enderw88@gmail.com> | 2012-11-06 14:04:27 -0700 |
---|---|---|
committer | Craig Earls <enderw88@gmail.com> | 2012-11-06 14:04:27 -0700 |
commit | e77e9d692aea5a061f6fde144a56de085b1a74c4 (patch) | |
tree | 22aabdfb6fa6af62801a0c584e8838b15e814577 /src/print.cc | |
parent | dc24ea721758b4a0121c78c4737492041a8dd093 (diff) | |
parent | 3a766aa7c5e58f65833966b4ca1a1d261b647b1b (diff) | |
download | ledger-e77e9d692aea5a061f6fde144a56de085b1a74c4.tar.gz ledger-e77e9d692aea5a061f6fde144a56de085b1a74c4.tar.bz2 ledger-e77e9d692aea5a061f6fde144a56de085b1a74c4.zip |
Merge branch 'next' of https://github.com/jwiegley/ledger into next
Diffstat (limited to 'src/print.cc')
-rw-r--r-- | src/print.cc | 13 |
1 files changed, 7 insertions, 6 deletions
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<std::string::size_type>(account_width) - static_cast<std::string::size_type>(name.length())); + std::size_t amount_width = + (report.HANDLED(amount_width_) ? + lexical_cast<std::size_t>(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<std::size_t>(report.HANDLER(amount_width_).str()) : - 12); - std::ostringstream amt_str; value_t(post->amount).print(amt_str, static_cast<int>(amount_width), -1, AMOUNT_PRINT_RIGHT_JUSTIFY | |