cosic.rescue
clone your own copy | download snapshot

Snapshots | iceberg

Inside this repository

mathfiltersextra.py
text/x-python

Download raw (330 bytes)

from django.template import Library


register = Library()


@register.filter(is_safe=False)
def addf(value, arg):
    """Adds the arg to the value."""
    try:
        return float(value) + float(arg)
    except (ValueError, TypeError):
        try:
            return value + arg
        except Exception:
            return ''