[ Jean-Francois.Doyon]
I have a tag as such: <dtml-var DMT_S_E null=N/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=N/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?
_.int() will convert a string or number to an integer, but a null is not a string or number. If you are just displaying the data (as with dtml-var), you do not really have to convert it into an integer anyway. This would avoid the problem. If you need to do some formatting, you ought to be able to do it with a formatting string rather than trying to convert to in integer. Also, once you work out what you want to do, you will want to use null="N/A", since the argument of null must be a string. Cheers, Tom P