>> Try string formatting:
>>
>> print '%.2f' % product.price
>>     
>
> That works. I expected Python to display the data exactly as it is in
> the database, like most languages.
It depends on what you get back from MySQLdb. Try this:

import decimal
d = decimal.Decimal("3.0000")
print d


Now try this:

d = float("3.0000")
print d


The problem is -- probably -- with your db module. It may return a float 
instead of a Decimal. I cannot help more with MySQL, because I do not 
use it. Sorry.


   Laszlo

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to