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 b222e865..a7d26256 100644
--- a/amount.cc
+++ b/amount.cc
@@ -296,10 +296,10 @@ static std::string amount_to_str(const commodity * comm, const mpz_t val,
else
s << '.';
- if (mpz_sgn(rquotient) == 0) {
+ if (! full_precision || mpz_sgn(rquotient) == 0) {
s.width(comm->precision);
s.fill('0');
- s << 0;
+ s << rquotient;
} else {
char buf[MAX_PRECISION + 1];
gmp_sprintf(buf, "%Zd", rquotient);