Math operation in template

If you really wanted to do it in the template, you could probably create a custom template tag or filter to do this.

However, it’s probably more in the Django-way of doing things by creating a model method for that field, and then render the results of that model method in your template.

See the Behind the scenes block in the variables section of the template docs.