RE: [Zope] How do I use the math module ?
Hi The following snippet (tested) works as expected, printing the values in three columns. <dtml-var standard_html_header> <dtml-call "REQUEST.set('WordList', ['word_a', 'word_b', 'word_c', 'word_d', 'word_e', 'word_f', 'word_g'])"> <dtml-in WordList> <dtml-unless sequence-start> <dtml-if "_.math.fmod(_['sequence-index'], 3) == 0"> <br> </dtml-if> </dtml-unless> <dtml-var sequence-item> </dtml-in> <dtml-var standard_html_footer> hth, -- Marcus
Hi,
I have a simple question - how do I use the fmod function in the math module with dtml ?
I've tried something like this(and a lot of variants):
<dtml-if expr="_.math.fmod(x,y) == 0"> do something </dtml-if>
What is it for:
I have some words returned from a search which I want to be displayed like this:
word_a word_b word_c word_d word_e word_f word_g word_h word_i
Thanks in advance.
Regards
------------------------------------------------- Anders Holmbech Nielsen | Tlf: (+45) 70 22 56 00 Software Engineer | Fax: (+45) 70 22 57 00 Integrator Uniware A/S | http:/www.integrator.dk
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Thanks, this works perfectly. I don't know why my code doesn't work because I have tried the same thing as you have. But I must have forgotten a "'" or something. Thanks again
Hi
The following snippet (tested) works as expected, printing the values in three columns.
<dtml-var standard_html_header> <dtml-call "REQUEST.set('WordList', ['word_a', 'word_b', 'word_c', 'word_d', 'word_e', 'word_f', 'word_g'])">
<dtml-in WordList> <dtml-unless sequence-start> <dtml-if "_.math.fmod(_['sequence-index'], 3) == 0"> <br> </dtml-if> </dtml-unless> <dtml-var sequence-item> </dtml-in> <dtml-var standard_html_footer>
hth,
-- Marcus
Hi,
I have a simple question - how do I use the fmod function in the math module with dtml ?
I've tried something like this(and a lot of variants):
<dtml-if expr="_.math.fmod(x,y) == 0"> do something </dtml-if>
What is it for:
I have some words returned from a search which I want to be displayed like this:
word_a word_b word_c word_d word_e word_f word_g word_h word_i
Thanks in advance.
Regards
------------------------------------------------- Anders Holmbech Nielsen | Tlf: (+45) 70 22 56 00 Software Engineer | Fax: (+45) 70 22 57 00 Integrator Uniware A/S | http:/www.integrator.dk
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Regards ------------------------------------------------- Anders Holmbech Nielsen | Tlf: (+45) 70 22 56 00 Software Engineer | Fax: (+45) 70 22 57 00 Integrator Uniware A/S | http:/www.integrator.dk
participants (2)
-
Anders Holmbech Nielsen -
Marcus Collins