diff options
author | John Wiegley <johnw@newartisans.com> | 2004-08-21 15:55:03 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2004-08-21 15:55:03 -0400 |
commit | 000bfe1cece3ecbfee8f07a46d1f0b000dbbc983 (patch) | |
tree | 6d2c666097900fff421da6a57b41f0a7c43a39b7 /format.cc | |
parent | 225acd14e57a0a476ce022a7c5703a8f1cee34ef (diff) | |
download | fork-ledger-000bfe1cece3ecbfee8f07a46d1f0b000dbbc983.tar.gz fork-ledger-000bfe1cece3ecbfee8f07a46d1f0b000dbbc983.tar.bz2 fork-ledger-000bfe1cece3ecbfee8f07a46d1f0b000dbbc983.zip |
only compute the cost when it differs from the amount
Diffstat (limited to 'format.cc')
-rw-r--r-- | format.cc | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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(); |