[Zope] Help with String conversion in Zope

McDonnell, Larry lmcdonnell@protonenergy.com
Thu, 12 Jun 2003 09:37:00 -0400


Hi,

I have set some these conversions in python

[dtml]

<dtml-call "string_to_float(input_string ,REQUEST)">

[python]

Parameter List x,y

# Example code:

# Import a standard function, and get the HTML request and response objects.
from Products.PythonScripts.standard import html_quote
request = container.REQUEST
RESPONSE =  request.RESPONSE

y=float(x)

return request.set('y',y)

[dtml]

<dtml-call "REQUEST.set('conv_number', y)">

Hope this helps...

-----Original Message-----
From: enrica dente [mailto:enrica_dente@hotmail.com]
Sent: Thursday, June 12, 2003 9:00 AM
To: zodb-dev@zope.org; zope-it@zope.org; help@zope.org; Zope@zope.org
Subject: [Zope] Help with String conversion in Zope


Dear all,

I have a problem checking if an input from a form is a string or not and 
then change it into a float. The Zope code I have written is as follows but 
it does not work.

<dtml-if expr="same_type(standardkit_cost, 'Test')">
   <dtml-call "REQUEST.set ('standardkit_cost', _.float(standardkit_cost))">

</dtml-if>


Thanks,
Enrica

_________________________________________________________________
Stay in touch with absent friends - get MSN Messenger 
http://www.msn.co.uk/messenger


_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )