Re: money types, decimal module

Timothy Smith <timothy-/[email protected]> Thu, 18 Nov 2004 09:10:05 +1000
Newsgroups gmane.comp.python.db.pypgsql.user
Message-ID <[email protected]>
Karsten Hilbert wrote:

>>hello i'm stuck with a problem. whats the best way to store money types. 
>>    
>>
>Use numeric.
>
>Karsten
>  
>
Ok i must be doing something wrong here i'm still getting the same error 
and i have changed my types to numeric.

 (EnteredBy,DateEntered,ForDate, ForVenue, TillName,Tape,Cash, GM, 
VenueManager, AsstManager, BarManager, PRCards,   otherPromo, Functions, 
Accounts, Spill, Orings, Variance))
  File "/usr/local/lib/python2.3/site-packages/pyPgSQL/PgSQL.py", line 
3048, in execute
    self.res = self.conn.conn.query(_qstr % parms)
TypeError: float argument required

here is my code i think is the problem
cur.execute("INSERT INTO DailyTakings VALUES (%s,%s, %s, 
%s,%s,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f)",
    (EnteredBy,DateEntered,ForDate, ForVenue, TillName,Tape,Cash, GM, 
VenueManager, AsstManager, BarManager, PRCards,    otherPromo, 
Functions, Accounts, Spill, Orings, Variance))
       






-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8