[prev in list] [next in list] [prev in thread] [next in thread] 

List:       zope
Subject:    Re: [Zope] ZSQL Method's Precision
From:       Tino Wildenhain <tino () wildenhain ! de>
Date:       2006-10-24 8:08:13
Message-ID: 453DC9ED.8050209 () wildenhain ! de
[Download RAW message or body]

Maciej Wisniowski schrieb:
> 
>> In a PostgreSQL DB I have a Numeric data type with a precision of two
>> decimal places. If I have 1.33 in as the result from my query, it's
>> everything is good. However, if I have 1.30 it reduces the precision
>> to one decimal place and I get 1.3. Not so good when dealing with
>> currency ( I don't want to use the money data dype ).
>>
>> Any ideas on how I can get my ZSQL method to keep two decimal places?
> As others said it's a matter of displaying. You say that you don't want
> to use money datatype but keep in mind that postgre adapter
> is able to use Python's Decimal datatype for money values (in python2.3
> you need additional module decimal.py from Python 2.4 to enable it)
> which may give you necessary precision for financial operations and is
> able to store really big numbers.

The adaptor should use it for numeric data as well (hey, hence the name 
;) Use of the deprecated money datatype in postgres isnt recommended.
(And its superceeded by numeric anyway)

Regards
Tino Wildenhain

_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic