[Zope] thousands_commas SOLVED

hpinson at indepthl.com hpinson at indepthl.com
Tue Aug 31 18:54:35 EDT 2004


Fantastic Count. Thanks!

I was struggling to place the python string.replace function directly 
in the dtml-var tag, and having the usual dtml syntax problems.

Here's what ended up working, for both input and output, allowing the 
use of commas for data entry, or not:

<form name="myForm: method="post" action="updateForm">

<input type="text" name="total_area:float" value="<dtml-var 
total_area thousands_commas null=0.00>

...Submit

</form>

and in dtml method updateForm

<dtml-call "REQUEST.set('total_area', _.string.replace(total_area,',',''))">
<dtml-call "REQUEST.set('total_area', _.float(total_area))"> 

<!-- Call the update SQL method.
<dtml-call name="SQL_updateTable">

<!- Reload the updated form. -->
<dtml-call expr="RESPONSE.redirect('.')">

The first two line are really the relevant ones.





Harlow Pinson
Indepth Learning
Email: hpinson at indepthl.com 
Web: http://www.indepthl.com
Voice: 505-994-2135
FAX: 208-475-7678



More information about the Zope mailing list