Filter for maths in template
Project description
=====
Django Template Maths
=====
Django Template Maths is a simple filter for execute maths in template
Quick start
-----------
1. Add "django_template_maths" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = [
...
'django_template_maths',
]
Example usage
-------------
```html
{% load django_template_maths %}
{{ 10|add:5 }} # print 15
{{ 10|sub:5 }} # print 5
{{ 10|div:5 }} # print 2
{{ 10|mul:5 }} # print 50
{{ 10|mod:5 }} # print 0
{{ 10|exp:5 }} # print 100000
{{ 10|flr:5 }} # print 2
{{ 10|sqr }} # 3.1622776601683795
{{ 10|add:5|add_decimal:2 }} # print 15.00
{{ 1000|add:5|add_decimal:2|separator:'comma' }} # print 1,005.00
{{ 1000|add:5|add_decimal:2|separator:'dot' }} # print 1.005,00
{{ 1000|remove_decimal|separator:'dot' }} # print 1.005
```
Django Template Maths
=====
Django Template Maths is a simple filter for execute maths in template
Quick start
-----------
1. Add "django_template_maths" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = [
...
'django_template_maths',
]
Example usage
-------------
```html
{% load django_template_maths %}
{{ 10|add:5 }} # print 15
{{ 10|sub:5 }} # print 5
{{ 10|div:5 }} # print 2
{{ 10|mul:5 }} # print 50
{{ 10|mod:5 }} # print 0
{{ 10|exp:5 }} # print 100000
{{ 10|flr:5 }} # print 2
{{ 10|sqr }} # 3.1622776601683795
{{ 10|add:5|add_decimal:2 }} # print 15.00
{{ 1000|add:5|add_decimal:2|separator:'comma' }} # print 1,005.00
{{ 1000|add:5|add_decimal:2|separator:'dot' }} # print 1.005,00
{{ 1000|remove_decimal|separator:'dot' }} # print 1.005
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for django-template-maths-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb78f14b945d1e6f4db953053188deb6169a8837a2663a4d378ed748b15a2f91 |
|
MD5 | bf190d0a3efb0f85e447c2aacc40e672 |
|
BLAKE2b-256 | f78703f730f19a64a8953b6dcd9ef4ef00657cd35f046c5f446e50810a8dd189 |