summaryrefslogtreecommitdiff
path: root/Modules/_decimal
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2014-08-26 20:47:32 +0200
committerStefan Krah <skrah@bytereef.org>2014-08-26 20:47:32 +0200
commit3f54ed85f4dc3f948993a46c8a23735df4c6d15f (patch)
tree452bd99e65225db01baddd1b93345838c60d25c6 /Modules/_decimal
parentc92c3893948079d210582c0e3b997e9cdc61a707 (diff)
parent03f5b7b27fc9955bc06ada46fe67e3ea9bb5990d (diff)
downloadcpython-3f54ed85f4dc3f948993a46c8a23735df4c6d15f.tar.gz
Merge 3.4.
Diffstat (limited to 'Modules/_decimal')
-rw-r--r--Modules/_decimal/libmpdec/io.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/Modules/_decimal/libmpdec/io.c b/Modules/_decimal/libmpdec/io.c
index b67324da94..a45a429dbf 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;