summaryrefslogtreecommitdiff
path: root/amount.cc
diff options
context:
space:
mode:
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');