[ZODB-Dev] RE: [Zope] Help with String conversion in Zope

McDonnell, Larry lmcdonnell at protonenergy.com
Thu Jun 12 10:37:00 EDT 2003


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 at hotmail.com]
Sent: Thursday, June 12, 2003 9:00 AM
To: zodb-dev at zope.org; zope-it at zope.org; help at zope.org; Zope at 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 at 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 )



More information about the ZODB-Dev mailing list