Jason C. Leach wrote:
1.3 and 1.30 are different only in terms display and printing. One
approach can be wrapping your calls to the zsql in a python script that
applies formatting before returning the relavent results.
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?
res = yourZSQL(params or request is all set up)
return "$%.2f" % res.yourAmountThatYouNeedToFORMAT
Zope maillist - Zope@zope.org
** No cross posts or HTML encoding! **
(Related lists -