how to multiply in django template

You can use widthratio builtin filter for multiplication and division.

To compute A*B: {% widthratio A 1 B %}

To compute A/B: {% widthratio A B 1 %}

Here is what the above code is Doing:
1. It’s creating a custom filter called widthratio.
2. It’s using the builtin filter filter to multiply or divide the values.
3. It’s returning the result of the multiplication or division.

To use this filter, you would use the following syntax:

{{ A|widthratio:1:B }}

{{ A|widthratio:B:1 }}