Number format...

Afanasiy abelikov72 at hotmail.com
Sat Jan 4 20:37:37 EST 2003


On Sun, 05 Jan 2003 01:21:09 GMT, Afanasiy <abelikov72 at hotmail.com>
wrote:

>What do I need to do to convert .1352345 to '0.14' ?
>
>>>> repr(round(.1352345,2))
>'0.14000000000000001'

I found the answer... 

  str(round(0.1352345,2)) == '0.14'

But have another question...

  str(round(0.1001,2)) == '0.1'

How do I pad with a zero now? ('0.10')




More information about the Python-list mailing list