Re: Using forloop.counter0 on a variable

2007-12-17 Thread Martin Conte Mac Donell
What about $ {% filter floatformat:2 %} {% get_element secondprice forloop.counter0 %} {% endfilter %} Regards, -- Martín Conte Mac Donell On Dec 17, 2007 6:53 PM, Greg <[EMAIL PROTECTED]> wrote: > > Martin, > Yep...that worked. Thanks! > > However, now I'm not using the '|fl

Re: Using forloop.counter0 on a variable

2007-12-17 Thread Greg
Martin, Yep...that worked. Thanks! However, now I'm not using the '|floatformat:2'. Is there anyway that I can use that in my template with the new way: ${% get_element secondprice forloop.counter0 %} For an example...currently I'm getting back 124.1...I would like to have it be 124.10 On D

Re: Using forloop.counter0 on a variable

2007-12-17 Thread Martin Conte Mac Donell
You can do that with a very simple template tag register = template.Library() @register.simple_tag def get_element(list, index): # You should catch IndexError here. return list[index] Template side: {% get_element secondprice forloop.counter0 %} Regards, Martin Conte Mac Donell > >

Using forloop.counter0 on a variable

2007-12-17 Thread Greg
Hello, I have the following in my template: {% for a in thespinfo %} {{ secondprice.forloop.counter0|floatformat:2 }} {% endfor %} However, nothing appears when I run this code /// My secondprice variable contians a list like ['25', '14', '56']. Each time that my for loop is run t