[Zope] Question about dtml-var, "null=", and data types

Jean-Francois.Doyon@CCRS.NRCan.gc.ca Jean-Francois.Doyon@CCRS.NRCan.gc.ca
Tue, 10 Sep 2002 16:26:53 -0400


Hello,

I have a tag as such: <dtml-var DMT_S_E null=3DN/A>

DMT_S_E is a variable that comes from a SQL Method with a PostgreSQL
backend. DMT_S_E is of pgsql data-type "float8".

Yet, for some reason, when I do <dtml-var "_.int(DMT_S_E)" null=3DN/A>, =
I get
an error about not being able to convert it to int. This is where the =
value
is null, and therefore "N/A" gets displayed.

So, does this mean that the "null" value has to be of the same =
data-type as
the variable itself? If so, this isn't documented in the DTML =
Reference. I
don't want to use "0" (Zero) as this would not be accurate. Is there an =
easy
alternative, or am I going to have to use an if-then statement?

Thanks,

Jean-Fran=E7ois Doyon
Internet Service Development and Systems Support
GeoAccess Division
Canadian Center for Remote Sensing
Natural Resources Canada
http://atlas.gc.ca
Phone: (613) 992-4902
Fax: (613) 947-2410