summaryrefslogtreecommitdiff
path: root/amount.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2007-04-23 04:42:44 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 03:38:30 -0400
commit6853db57e6fdb6fd95764be1f35af0006c9e2ef9 (patch)
treebf24550cbc6053c51bf2f3fdcf27f39a4c989f24 /amount.cc
parentbe9f18ccfe81acdd2f34b27352f2843235fab69b (diff)
downloadfork-ledger-6853db57e6fdb6fd95764be1f35af0006c9e2ef9.tar.gz
fork-ledger-6853db57e6fdb6fd95764be1f35af0006c9e2ef9.tar.bz2
fork-ledger-6853db57e6fdb6fd95764be1f35af0006c9e2ef9.zip
All tests now working again. Reduced size of entity_t and
transaction_t considerably.
Diffstat (limited to 'amount.cc')
-rw-r--r--amount.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/amount.cc b/amount.cc
index 49104f10..de6cdd3a 100644
--- a/amount.cc
+++ b/amount.cc
@@ -980,7 +980,7 @@ void amount_t::print(std::ostream& _out, bool omit_commodity,
if (negative)
out << "-";
- if (mpz_sgn(quotient) == 0) {
+ if (! quantity || mpz_sgn(quotient) == 0) {
out << '0';
}
else if (! (comm.flags() & COMMODITY_STYLE_THOUSANDS)) {
@@ -1022,7 +1022,7 @@ void amount_t::print(std::ostream& _out, bool omit_commodity,
}
}
- if (precision) {
+ if (quantity && precision) {
std::ostringstream final;
final.width(precision);
final.fill('0');