Number format...

Justin Shaw wyojustin at hotmail.com
Sat Jan 4 20:31:15 EST 2003


"Afanasiy" <abelikov72 at hotmail.com> wrote in message
news:892f1vc2o4fbfd023ottrjepv8344hpc9q at 4ax.com...
> What do I need to do to convert .1352345 to '0.14' ?
>
> >>> repr(round(.1352345,2))
> '0.14000000000000001'

Try this.
>>> print '%.2f' % .1352345
0.14

Justin






More information about the Python-list mailing list