diff options
author | Stefan Krah <skrah@bytereef.org> | 2014-08-26 18:47:32 (GMT) |
---|---|---|
committer | Stefan Krah <skrah@bytereef.org> | 2014-08-26 18:47:32 (GMT) |
commit | 9ea83cff473a8dea3fa4c34e0036c3de3e09b77e (patch) | |
tree | 20f2e96d0b19c4f633273ff6e5ee3204fa4985bc /Modules | |
parent | e863739e61996f5bf48a14b2fe69a95d23fe45e0 (diff) | |
parent | 298131a44896a4fec1ea829814ad52409d59aba5 (diff) | |
download | cpython-9ea83cff473a8dea3fa4c34e0036c3de3e09b77e.zip cpython-9ea83cff473a8dea3fa4c34e0036c3de3e09b77e.tar.gz cpython-9ea83cff473a8dea3fa4c34e0036c3de3e09b77e.tar.bz2 |
Merge 3.4.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_decimal/libmpdec/io.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Modules/_decimal/libmpdec/io.c b/Modules/_decimal/libmpdec/io.c index b67324d..a45a429 100644 --- a/Modules/_decimal/libmpdec/io.c +++ b/Modules/_decimal/libmpdec/io.c @@ -446,7 +446,7 @@ _mpd_to_string(char **result, const mpd_t *dec, int flags, mpd_ssize_t dplace) if (mpd_isspecial(dec)) { - mem = sizeof "-Infinity"; + mem = sizeof "-Infinity%"; if (mpd_isnan(dec) && dec->len > 0) { /* diagnostic code */ mem += dec->digits; @@ -609,10 +609,10 @@ _mpd_to_string(char **result, const mpd_t *dec, int flags, mpd_ssize_t dplace) *cp++ = (flags&MPD_FMT_UPPER) ? 'E' : 'e'; cp = exp_to_string(cp, ldigits-dplace); } + } - if (flags&MPD_FMT_PERCENT) { - *cp++ = '%'; - } + if (flags&MPD_FMT_PERCENT) { + *cp++ = '%'; } assert(cp < decstring+mem); @@ -1260,6 +1260,9 @@ mpd_qformat_spec(const mpd_t *dec, const mpd_spec_t *spec, stackspec.align = '>'; spec = &stackspec; } + if (type == '%') { + flags |= MPD_FMT_PERCENT; + } } else { uint32_t workstatus = 0; |