Mark Dickinson <dicki...@gmail.com> added the comment: For 'g' formatting (either {} style or %-style) with precision p >= 1, I believe fixed- point is used if and only if the formatted value satisfies
1e-4 <= abs(formatted_value) < 10**precision. Note that the 'formatted value' refers to the value rounded to p significant figures, not the original value of the number being formatted. For example, in '%.6g' % 9.999999e-5, the float rounded to 6 places is 1e-4, so the result is '0.0001', using fixed-point. But '%.6g' % 9.999994e-5 gives '9.99999e-05'. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue7051> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com