[New-bugs-announce] [issue23460] Decimals do not obey ':g' exponential notation formatting rules

Ian Kelly report at bugs.python.org
Fri Feb 13 18:15:21 CET 2015


New submission from Ian Kelly:

>>> '{:g}'.format(D('0.000001'))
'0.000001'

Formatted with '{:e}', the exponent would be -6, so per the formatting rules described under the 'g' specifier at https://docs.python.org/3/library/string.html#format-specification-mini-language the above should be formatted using exponential notation.

----------
components: Library (Lib)
messages: 235904
nosy: ikelly
priority: normal
severity: normal
status: open
title: Decimals do not obey ':g' exponential notation formatting rules
type: behavior
versions: Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23460>
_______________________________________


More information about the New-bugs-announce mailing list