Eric V. Smith added the comment:

By using %s, you're asking the formatting code to first convert the parameter 
to a string. Then, by using .10, you're asking it to truncate the value.

It's essentially equivalent to:

>>> str(-7.7176718e-05)
'-7.7176718e-05'
>>> str(-7.7176718e-05)[:10]
'-7.7176718'

and:

>>> str(-0.0000771767)
'-7.71767e-05'
>>> str(-0.0000771767)[:10]
'-7.71767e-'

This isn't a bug. If you want more control over the formatting, use %f, %e, or 
%g:

>>> '%.10f' % -7.7176718e-05
'-0.0000771767'

----------
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23627>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to