---
# System prepended metadata

title: Multiplications in Django

---

# Multiplications in Django

## the refrcense for this actions 

https://stackoverflow.com/questions/60381983/why-is-widthratio-multiplication-not-working-in-my-template




You can't use template tags inside if statement conditionals like that. What you can do is first assign the output of widthratio to a template variable, and then compare that in your if statement:

`{% widthratio articlestat.score 1 TRENDING_PCT_FLOOR as ratio %}`
`{% if ratio >= articlestat.weighted_score %}style="font-weight:bold;"{% endif %}`
