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 georg.brandl
Recipients georg.brandl, travelgirl
Date 2007-12-05.21:09:25
SpamBayes Score 0.30631104
Marked as misclassified No
Message-id <1196888965.65.0.270096217164.issue1559@psf.upfronthosting.co.za>
In-reply-to
Content
round() does not return a string, but a floating point number, the best
approximation to the "real" result that is achievable with the limited
precision of binary floating point.

That result is then formatted to a string for display by the interactive
interpreter using the repr() function, which formats a float with (I
think) 17 decimal digits.

So, the point here is that repr() produces "too many" digits for your
liking ;) You can use str() to cut off at fewer digits, which will
produce the "correct" string in most cases.
History
Date User Action Args
2007-12-05 21:09:25georg.brandlsetspambayes_score: 0.306311 -> 0.30631104
recipients: + georg.brandl, travelgirl
2007-12-05 21:09:25georg.brandlsetspambayes_score: 0.306311 -> 0.306311
messageid: <1196888965.65.0.270096217164.issue1559@psf.upfronthosting.co.za>
2007-12-05 21:09:25georg.brandllinkissue1559 messages
2007-12-05 21:09:25georg.brandlcreate