[Zope] Re: How to calculate variables using DTML

Tobias Herp therp at apriori.de
Fri Sep 12 23:40:25 EDT 2003


Alexander Alvarado schrieb:
> TTP= ( T_ADT + T_SRC + T_CHD)*TT_NITES
> 
> As I recieve this variables from a previous form I guess I have to 
> convert them into integer I thought that <dtml-set 
> TTP="(_.int(ADT)+_.int(CHD)+_.int(SRC)*(_.int(TT_NITES))"> would work, 
> but it does not.

How about this:

<dtml-let
   TTP="(_.int(ADT)+_.int(CHD)+_.int(SRC))*_.int(TT_NITES)"
   >

(my indenting method, handy for more than one variable ;-)

Alternatively you can convert your variables directly into integers by 
appending :int to the input names.

hth,

Tobias





More information about the Zope mailing list