Christian Iversen c...@sikkerhed.org added the comment:
Terry, the %g format always trims trailing zeroes, so you'd have to try with a
number that doesn't end in zero.
I had to make a re-implementation of format for javascript:
http://paste.pocoo.org/show/513078/
If you look at the %g case,
Terry J. Reedy tjre...@udel.edu added the comment:
I find the doc for g/G less than clear.
1. (main entry) Uses lowercase exponential format if exponent is less than -4
or not less than precision, decimal format otherwise.
'not less' means 'equal or greater', which to me is clearer. Even
Christian Iversen c...@sikkerhed.org added the comment:
Certainly, I don't think we should be peppering the docs with warnings and
notes, either.
However, the elements in question _already have_ notes. I propose that the note
for %g (4) simply be updated for clarity. Something like this,
Éric Araujo mer...@netwok.org added the comment:
I agree with Mark. The Documenting Python docs were recently updated by
Raymond Hettinger to recommend not abusing notes and warnings, and the doc
maintainer Georg Brandl approved it: d5d91b14b238 (#12047).
--
nosy: +eric.araujo
New submission from Christian Iversen c...@sikkerhed.org:
The documentation for string format options state that both %f, %g and %e
default to 6 digits after the decimal point. In fact, %g always seems to use 5
digits by default:
%g % 2.1234567
'2.12346'
%f % 2.1234567
'2.123457'
%e %
Mark Dickinson dicki...@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
Christian Iversen c...@sikkerhed.org added the comment:
That was exactly the page I was looking at, and after some discussion on
#python, I can see how they differ.
Perhaps this could be clarified in the documentation? It's very easy to miss as
it is now. Maybe a note describing that %g is
Mark Dickinson dicki...@gmail.com added the comment:
Maybe a note describing that %g is different from the others in this regard?
-1 from me; I don't really see that that would improve the documentation.
Maybe that's just me, but I expect reference documentation to be clean, and
Changes by Eric V. Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13433
___
___
Python-bugs-list
Changes by Mark Dickinson dicki...@gmail.com:
--
versions: +Python 3.2, Python 3.3 -Python 2.6
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13433
___
10 matches
Mail list logo