summaryrefslogtreecommitdiff
path: root/amount.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2003-10-04 01:54:30 +0000
committerJohn Wiegley <johnw@newartisans.com>2003-10-04 01:54:30 +0000
commit3ef7bfdb32d770812e9805474ea9956568385efe (patch)
tree9bd7673055d3a5ff03caf0d4f9ba63a8c2a45cc7 /amount.cc
parent3cfae2794784c1629dd98c0b600b2731e27a3f57 (diff)
downloadfork-ledger-3ef7bfdb32d770812e9805474ea9956568385efe.tar.gz
fork-ledger-3ef7bfdb32d770812e9805474ea9956568385efe.tar.bz2
fork-ledger-3ef7bfdb32d770812e9805474ea9956568385efe.zip
Added support for virtual accounts.
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();
}