This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.smith
Recipients eric.smith, pushpendre rastogi
Date 2015-03-10.15:01:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1425999669.37.0.287094295348.issue23627@psf.upfronthosting.co.za>
In-reply-to
Content
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'
History
Date User Action Args
2015-03-10 15:01:09eric.smithsetrecipients: + eric.smith, pushpendre rastogi
2015-03-10 15:01:09eric.smithsetmessageid: <1425999669.37.0.287094295348.issue23627@psf.upfronthosting.co.za>
2015-03-10 15:01:09eric.smithlinkissue23627 messages
2015-03-10 15:01:09eric.smithcreate