Home > Blockchain >  intcomma after widthratio in Django templates
intcomma after widthratio in Django templates

Time:06-04

I want to do "intcoma" after "widthratio" in the Django template. I thought about it as below, but it doesn't work.

{{ {% widthratio p.price 2 1 %}|intcomma }}

CodePudding user response:

You have to split the code in two parts

{% widthratio p.price 2 1 as price_ratio %}{{ price_ratio|intcomma }}
  • Related