summaryrefslogtreecommitdiff
path: root/amount.cc
diff options
context:
space:
mode:
Diffstat (limited to 'amount.cc')
-rw-r--r--amount.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/amount.cc b/amount.cc
index 8d1752a0..8d67bd3b 100644
--- a/amount.cc
+++ b/amount.cc
@@ -425,12 +425,17 @@ const std::string gmp_amount::as_str(bool full_prec) const
{
std::ostringstream s;
- assert(quantity_comm);
- s << amount_to_str(quantity_comm, quantity, full_prec);
+ if (quantity_comm)
+ s << amount_to_str(quantity_comm, quantity, full_prec);
+ else
+ s << quantity;
if (priced) {
- assert(price_comm);
- s << " @ " << amount_to_str(price_comm, price, full_prec);
+ s << " @ ";
+ if (price_comm)
+ s << amount_to_str(price_comm, price, full_prec);
+ else
+ s << price;
}
return s.str();
}