[issue13433] String format documentation contains error regarding %g

Mark Dickinson report at bugs.python.org
Sat Nov 19 14:26:24 CET 2011


Mark Dickinson <dickinsm at gmail.com> added the comment:

Yep, there's an oddity here that's directly inherited from C's sprintf family of functions, namely that in %e-style formatting you give the number of digits after the point (= one less than the total number of significant digits), and in %g-style formatting you give the total number of significant digits instead.

Can you give a pointer, or link, to the documentation section you were looking at?

The description at:

http://docs.python.org/library/stdtypes.html#string-formatting-operations

looks fine to me.  Note 3, which relates to the '%e' and '%f'-style formatting, talks about number of places after the point.  Note 4, which relates to '%g' formatting, talks about the total number of significant digits.

----------
nosy: +mark.dickinson

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


More information about the Python-bugs-list mailing list