Decimal Places Incorrect

Dan Bishop danb_83 at yahoo.com
Wed Jun 8 21:09:44 EDT 2005


Tom Haddon wrote:
> Hi Folks,
>
> When I run:
>
> print "%0.2f" % ((16160698368/1024/1024/1024),)
>
> I get 15.00
>
> I should be getting 15.05. Can anyone tell me why I'm not?

Because you forgot to use "from __future__ import division".




More information about the Python-list mailing list