diff options
author | John Wiegley <johnw@newartisans.com> | 2006-03-04 15:27:38 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 05:48:44 -0400 |
commit | 687eaefc375c06b122f83e4235745837add195d5 (patch) | |
tree | 05d296b0b6f0655bb5dc1471cc244681f0e46f80 | |
parent | 65682175e14855a3fe16e1c2636b8cb2dffa7610 (diff) | |
download | fork-ledger-687eaefc375c06b122f83e4235745837add195d5.tar.gz fork-ledger-687eaefc375c06b122f83e4235745837add195d5.tar.bz2 fork-ledger-687eaefc375c06b122f83e4235745837add195d5.zip |
*** no comment ***
-rw-r--r-- | amount.cc | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -812,10 +812,14 @@ std::ostream& operator<<(std::ostream& _out, const amount_t& amt) if (precision) { out << ((comm.flags & COMMODITY_STYLE_EUROPEAN) ? ',' : '.'); + char * p = mpz_get_str(NULL, 10, rquotient); + int len = std::strlen(p); + if (len < precision) + precision = len < comm.precision() ? comm.precision() : len; + out.width(precision); out.fill('0'); - char * p = mpz_get_str(NULL, 10, rquotient); out << p; std::free(p); } |