Chien Try this <dtml-var "_.float(a)/_.float(b)*_.float(c)"> You calculation is using integers and there is no automatic conversion being done. You need to explicitly tell zope that you want float calculations. HTH Phil phil.harris@zope.co.uk ----- Original Message ----- From: "Chien-pin Wang" <cpw@suprize.com> To: <zope@zope.org> Sent: Thursday, March 16, 2000 5:57 AM Subject: [Zope] expression evaluateion
Hi,
Zope seems to evaluate expressions in an unconventional way. Say I have three properties, a=3, b=5, c=7 set in a Folder. In a DTML Document I tried to say <dtml-var "a/b*c"> and got result 0. The expression was evaluated as a/(b*c) and rounded off. Is not the expression supposed to be evaluated as (a/b)*3? The result is not correct still if we put it this way: <dtml-var "(a/b)*3">. I still got 0 as the result. Did I miss anything fundamentally or is this a, bug?
Chien-pin
_______________________________________________ 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 )