summaryrefslogtreecommitdiff
path: root/src/print.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/print.cc')
-rw-r--r--src/print.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/print.cc b/src/print.cc
index c0817950..9be3b511 100644
--- a/src/print.cc
+++ b/src/print.cc
@@ -245,10 +245,18 @@ namespace {
if (post->cost &&
! post->has_flags(POST_CALCULATED | POST_COST_CALCULATED)) {
+ std::string cost_op;
if (post->has_flags(POST_COST_IN_FULL))
- amtbuf << " @@ " << post->cost->abs();
+ cost_op = "@@";
else
- amtbuf << " @ "
+ cost_op = "@";
+ if (post->has_flags(POST_COST_VIRTUAL))
+ cost_op = "(" + cost_op + ")";
+
+ if (post->has_flags(POST_COST_IN_FULL))
+ amtbuf << " " << cost_op << " " << post->cost->abs();
+ else
+ amtbuf << " " << cost_op << " "
<< (*post->cost / post->amount).abs();
}