From 3ef7bfdb32d770812e9805474ea9956568385efe Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sat, 4 Oct 2003 01:54:30 +0000 Subject: Added support for virtual accounts. --- amount.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'amount.cc') 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(); } -- cgit v1.2.3