summaryrefslogtreecommitdiff
path: root/src/print.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-06-07 08:23:22 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-06-07 08:32:14 -0400
commitc85cf0d810846e6ffc2a45b7283adacc202db30f (patch)
treeb444a914c8551951556a15794a94810d38b62414 /src/print.cc
parenta4d4f9979486eb82c05bd032e1452c2fd400249f (diff)
downloadfork-ledger-c85cf0d810846e6ffc2a45b7283adacc202db30f.tar.gz
fork-ledger-c85cf0d810846e6ffc2a45b7283adacc202db30f.tar.bz2
fork-ledger-c85cf0d810846e6ffc2a45b7283adacc202db30f.zip
Fixed the way prices and costs are print'd
Diffstat (limited to 'src/print.cc')
-rw-r--r--src/print.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/print.cc b/src/print.cc
index 5a72b03e..84aa441f 100644
--- a/src/print.cc
+++ b/src/print.cc
@@ -177,9 +177,9 @@ namespace {
report.HANDLER(amount_width_).value.to_int() : 12);
std::ostringstream amt_str;
- report.scrub(post->amount)
- .print(amt_str, amount_width, -1, AMOUNT_PRINT_RIGHT_JUSTIFY |
- AMOUNT_PRINT_NO_COMPUTED_ANNOTATIONS);
+ value_t(post->amount).print(amt_str, amount_width, -1,
+ AMOUNT_PRINT_RIGHT_JUSTIFY |
+ AMOUNT_PRINT_NO_COMPUTED_ANNOTATIONS);
amt = amt_str.str();
}
@@ -191,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;