diff options
author | Anthon van der Neut <anthon@mnt.org> | 2018-06-13 08:44:03 +0200 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2018-06-13 08:44:03 +0200 |
commit | e9ee46dea6d1e1fdc19b42914696aba8a985fc31 (patch) | |
tree | 2374982d5de6a3db0f459a581796982e4278a18a /representer.py | |
parent | abb4161983a5d93149e01e590362510e59fc3c6e (diff) | |
parent | 13a883ccbdcba12f942c134aceb9e38fe70f372f (diff) | |
download | ruamel.yaml-e9ee46dea6d1e1fdc19b42914696aba8a985fc31.tar.gz |
Merge PR29, fixes issue #195
*When this change indeed resolves your problem, please **Close** this issue*.
*(You can do so usingthe WorkFlow pull-down (close to the top right of this page)*
Diffstat (limited to 'representer.py')
-rw-r--r-- | representer.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/representer.py b/representer.py index 25e53b9..43f2c06 100644 --- a/representer.py +++ b/representer.py @@ -782,7 +782,9 @@ class RoundTripRepresenter(SafeRepresenter): value += u'0' else: # exponent - m, es = u'{:{}e}'.format(data, data._width).split('e') + m, es = u'{:{}.{}e}'.format( + data, data._width, data._width - data._prec + (1 if data._m_sign else 0) + ).split('e') w = data._width if data._prec > 0 else (data._width + 1) if data < 0: w += 1 |