Check the value of b.value.  Make sure it isn’t None.

From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of sum abiut
Sent: Wednesday, February 21, 2018 4:06 PM
To: django-users@googlegroups.com
Subject: django mathfiters


Hi,
How to you a zero in mathfilter
for example, if the value of c is zero the total is not display. instead of 
displaying 42 it display nothing.

{%for b in pay%}

{% with a=42 c=b.value%}

    <li> {{ a|add:c }}</li>

    {% endwith %}

--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
django-users+unsubscr...@googlegroups.com<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to 
django-users@googlegroups.com<mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPCf-y5F9bP8AVU2qXhXjMPhK4kwHBfWza2WL7j424VUkAgCRg%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CAPCf-y5F9bP8AVU2qXhXjMPhK4kwHBfWza2WL7j424VUkAgCRg%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a975b53b163440e990433832734b598f%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.

Reply via email to