summaryrefslogtreecommitdiff
path: root/format.cc
diff options
context:
space:
mode:
Diffstat (limited to 'format.cc')
-rw-r--r--format.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/format.cc b/format.cc
index 6d9f9384..44307d05 100644
--- a/format.cc
+++ b/format.cc
@@ -289,8 +289,8 @@ void format_t::format_elements(std::ostream& out,
std::string disp;
bool use_disp = false;
- if (details.xact->amount != details.xact->cost) {
- amount_t unit_cost = details.xact->cost / details.xact->amount;
+ if (details.xact->cost) {
+ amount_t unit_cost = *details.xact->cost / details.xact->amount;
std::ostringstream stream;
stream << details.xact->amount << " @ " << unit_cost;
disp = stream.str();