summaryrefslogtreecommitdiff
path: root/src/print.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-06-09 05:44:06 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-06-09 05:44:06 -0400
commit14476a63f4abbdce5311ace031b7345a34af060b (patch)
treec1900d4f2a95db2cdb4cf7404669fe668acedb4a /src/print.cc
parente8ffbd6f2fb57f2b65f57f92edf8eb444cc2f71f (diff)
parent474d95adeb09b0c13f0e19b336b5b01ee69c6275 (diff)
downloadfork-ledger-14476a63f4abbdce5311ace031b7345a34af060b.tar.gz
fork-ledger-14476a63f4abbdce5311ace031b7345a34af060b.tar.bz2
fork-ledger-14476a63f4abbdce5311ace031b7345a34af060b.zip
Merge branch 'next'
Diffstat (limited to 'src/print.cc')
-rw-r--r--src/print.cc19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/print.cc b/src/print.cc
index 703e885c..84aa441f 100644
--- a/src/print.cc
+++ b/src/print.cc
@@ -172,13 +172,14 @@ namespace {
if (post->amount_expr) {
amt = post->amount_expr->text();
} else {
- std::size_t amount_width =
+ int amount_width =
(report.HANDLER(amount_width_).specified ?
- report.HANDLER(amount_width_).value.to_long() : 12);
+ report.HANDLER(amount_width_).value.to_int() : 12);
std::ostringstream amt_str;
- report.scrub(post->amount)
- .print(amt_str, static_cast<int>(amount_width), -1, true);
+ value_t(post->amount).print(amt_str, amount_width, -1,
+ AMOUNT_PRINT_RIGHT_JUSTIFY |
+ AMOUNT_PRINT_NO_COMPUTED_ANNOTATIONS);
amt = amt_str.str();
}
@@ -190,15 +191,17 @@ namespace {
amtbuf << string(2 - (slip + amt_slip), ' ');
amtbuf << amt;
- if (post->cost && ! post->has_flags(POST_CALCULATED)) {
+ if (post->cost &&
+ ! post->has_flags(POST_CALCULATED | POST_COST_CALCULATED)) {
if (post->has_flags(POST_COST_IN_FULL))
- amtbuf << " @@ " << report.scrub(post->cost->abs());
+ amtbuf << " @@ " << post->cost->abs();
else
- amtbuf << " @ " << report.scrub((*post->cost / post->amount).abs());
+ amtbuf << " @ "
+ << (*post->cost / post->amount).abs();
}
if (post->assigned_amount)
- amtbuf << " = " << report.scrub(*post->assigned_amount);
+ amtbuf << " = " << post->assigned_amount;
string trailer = amtbuf.str();
out << trailer;