On Nov 7, 6:36 am, Dan Bishop <[EMAIL PROTECTED]> wrote: > On Nov 6, 3:46 pm, Astley Le Jasper <[EMAIL PROTECTED]> wrote: > > > I've been getting errors recently when using pysqlite. I've declared > > the table columns as real numbers to 2 decimal places (I'm dealing > > with money), but when doing division on two numbers that happen to > > have no decimal fractions, the results through pysqlite are coming > > through as integers. The funny thing is that when looking at the > > database using SQLite Manager or SQLite Pro the results there are > > displayed correctly. As a temporary fix I've had to multiply one of > > the numbers with 1.0 which has fixed it but I wonder if there is > > something else I'm doing wrong. > > You're using old-style division. Put the line "from __future__ import > division" in your script.
Hi, But the calculations are being done within a sql statement within SQLite? ([actual_price]-[recommended_price])/[recommended_price] -- http://mail.python.org/mailman/listinfo/python-list