diff options
Diffstat (limited to 'ishtar_common')
| -rw-r--r-- | ishtar_common/templatetags/units.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ishtar_common/templatetags/units.py b/ishtar_common/templatetags/units.py new file mode 100644 index 000000000..d4d755265 --- /dev/null +++ b/ishtar_common/templatetags/units.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from django.template import Library + +register = Library() + +@register.filter +def m2_to_ha(value): + try: + value = float(value)/10000 + except: + return "" + return "%.2f" % round(value, 2) + |
