[Zope] formatting problem...

Paul Zwarts paul.zwarts@oratrix.com
Thu, 15 Mar 2001 17:12:05 +0100


Hi Daniel,

I have had similar problems with MySQL... What I use to get around it is to send
it through the integer module. You'll find this also handy for converting
strings that only contain numbers and dates to floats and yadda yadda....:

<dtml-var "_.int(varname)">

Anyone got a better one? Or rather, explain why MySQL translates everthing as
long integers? Is this ALWAYS the case when defining a dbase field as INT4?
Cheers,
Paz

Daniel Corrêa de Azevedo wrote:

>     Hello you all.
>     I´m having problem in using FMT atribute of the DTML-VAR tag in dtml
> methods. The situation is that when I receive some integer data from a MYSQL
> database, I get it with a L sufix. That makes it necessary to format the
> data with <dtml-var key fmt="%d">. Now, the problem is that, sometimes, I
> need to keep on passing the data over to a few dtml methods, and when ever I
> need to reformat the data, I get an erro message: " Ilegal argument type for
> built-in operation.".
>    I need to reformat because the data in the other dtml-methods in the
> sequece may be being received from the MYSQL database.
>    How coud I reformat the data using <dtml-var key FMT="????">, even if it
> has already been formated by <dtml-var key fmt="%d">?
>
>    Thanks,
>                                                         Daniel C. Azevedo
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )