[Zope] Extrange behavior with numeric datatypes and decimal places

Luis Mariano Luporini lluporini at yahoo.com.ar
Mon Aug 11 20:09:56 EDT 2003


You're right but anyway I suppose I'll handle it with formatting options.

Thanks Chris.

Luis.

Chris Withers wrote:

> 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