Finagling Around Strange Zope Quirk
Hi; I have a variable that is set thus: <dtml-call "REQUEST.set('shipping',_.int(subtotal)*.05)"> and sent in a form thus: <input type=hidden name=shipping value=<dtml-var shipping>> where I would like it to be called thus: <dtml-var shipping fmt=dollars-and-cents> That doesn't work. I thought maybe it had been converted to a string, so I tried this: <dtml-let shippingit="_.int(shipping)"> <dtml-var shippingit fmt=dollars-and-cents> </dtml-let> but that threw an error that it was already an integer and could not be converted. I give! How do I get this variable to render in dollars-and-cents? Can I convert the integer into a string and work that angle? TIA, BenO
[Ben Ocean]
I have a variable that is set thus: <dtml-call "REQUEST.set('shipping',_.int(subtotal)*.05)"> and sent in a form thus: <input type=hidden name=shipping value=<dtml-var shipping>> where I would like it to be called thus: <dtml-var shipping fmt=dollars-and-cents> That doesn't work.
Yes, it does. To be more precise, I tried this (making up a value for subtotal): <dtml-let subtotal="3.50"> &dtml-subtotal;<br> <dtml-call "REQUEST.set('shipping',_.int(subtotal)*.05)"> &dtml-shipping;<br> <dtml-var shipping fmt=dollars-and-cents> </dtml-let> Here is the result: 3.5 0.15 $0.15 I also tried it with a value of 4 instead of 3.50, and it still worked fine. That's why I say it does work (Windows2000, Zope 2.3.3). Why do you say it doesn't? Methinks you have some other problem... Cheers, Tom P
participants (2)
-
Ben Ocean -
Thomas B. Passin