[Zope] Invalid Literal for Int()
Ben Ocean
zope@thewebsons.com
Sun, 06 Jan 2002 13:39:47 -0800
Hi;
I have a form in which I create a variable like this:
<dtml-call "REQUEST.set('shipping',_.int(subtotal)*.05)">
<input type=hidden name=shipping value=<dtml-var shipping>>
which is successfully used in said form like this:
<dtml-if shipping>
<tr>
<td><font style="font: <dtml-var "sizeCalc(15,size(_.None,_))">px
verdana">Shipping:</font></td>
<td><font style="font: <dtml-var "sizeCalc(15,size(_.None,_))">px
verdana"><dtml-var shipping fmt=dollars-and-cents></font></td>
</tr>
</dtml-if>
but when I try to render it in the form to which I pass it like this:
<dtml-if shipping>
<tr>
<td><font style="font: <dtml-var "sizeCalc(15,size(_.None,_))">px
verdana">Shipping</font></td>
<td> </td>
<td> </td>
<td><font style="font: <dtml-var "sizeCalc(15,size(_.None,_))">px
verdana"><dtml-var shipping fmt=dollars-and-cents></font></td>
</tr>
</dtml-if>
it doesn't render at all! So I try something sneaky like this:
<dtml-if shipping>
<dtml-let shippingit="shipping+0.00">
<tr>
<td><font style="font: <dtml-var "sizeCalc(15,size(_.None,_))">px
verdana">Shipping</font></td>
<td> </td>
<td> </td>
<td><font style="font: <dtml-var "sizeCalc(15,size(_.None,_))">px
verdana"><dtml-var shippingit fmt=dollars-and-cents></font></td>
</tr>
</dtml-let>
</dtml-if>
and I get this error:
Error Type: ValueError
Error Value: invalid literal for int(): 126.0
I'd just like the stupid thing to show up in dollars-and-cents. Any ideas?
TIA,
BenO