[Zope] Extrange behavior with numeric datatypes and decimal places
Chris Withers
chrisw at nipltd.com
Thu Aug 7 18:51:48 EDT 2003
Luis Mariano Luporini wrote:
> Chris:
>
> That is the code I'm having problems with.
I know, that's why I asked you to supply it so we can take a look and help you!
> If I run that in psql,
> I get the number of decimal places specified by the numeric casting but,
> if I run it in a zsql I get just un decimal place regardless of what is
> specified in the cast operation.
The DA is probably turning the returned number into a python Float, the default
representation of which has one decimal place.
> As suggested by Neil Smith in the zope-db list I could use a
> formating mask in dtml or zpt but I think that default behavior should
> be to left the query as it is.
Then you'd get a string ;-) Most people want numbers when they select numeric
columns from relational databases...
Chris
More information about the Zope
mailing list