Hi!

> -----Original Message-----
> From: Coleman, Bryan [mailto:[EMAIL PROTECTED]]
> Sent: 02 June 2000 15:20
> To: '[EMAIL PROTECTED]'
> Subject: [Zope] DTML newbie question on summation
> 
> 
> I can't seem to add variables using let. I just get a 
> concatination of the integers. I am using ...
> 
> <dtml-let total="SUNDAY + MONDAY + TUESDAY + WEDNESDAY + 
> THURSDAY + FRIDAY + SATURDAY">
> 
> The days represent hours but are stored as integers in the database.

While they're stored as integers, some of the database adaptors return
everything as strings. This would seem to be borne out by the concatenation.

Try: 

<dtml-let total="_.int(SUNDAY) + _.int(MONDAY) + _.int(TUESDAY) +
_.int(WEDNESDAY) + _.int(THURSDAY) + _.int(FRIDAY) + _.int(SATURDAY)">

to explicitly convert your results to integers.

hth,

-- Marcus

_______________________________________________
Zope maillist  -  [EMAIL PROTECTED]
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 )

Reply via email to