summaryrefslogtreecommitdiff
path: root/amount.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2003-09-30 05:43:49 +0000
committerJohn Wiegley <johnw@newartisans.com>2003-09-30 05:43:49 +0000
commitff57781f1fc80024ae6387f29b2f06278acadb3b (patch)
tree134bc7fa4e706db2c746f8017b0184156db90e0e /amount.cc
parent52ed6fa013bc7cb4d377ab308a6b87536efb1e96 (diff)
downloadfork-ledger-ff57781f1fc80024ae6387f29b2f06278acadb3b.tar.gz
fork-ledger-ff57781f1fc80024ae6387f29b2f06278acadb3b.tar.bz2
fork-ledger-ff57781f1fc80024ae6387f29b2f06278acadb3b.zip
*** empty log message ***
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);