I have this variable:
{{ object.article.rating.get_percent|floatformat }}
that outputs this:
540787
Is there a way to format it so it shows as:
540,787
this should help you out: http://twigstechtips.blogspot.com/2010/02/django-formatting-numbers-with-commas.html
details: add "django.contrib.humanize" to your INSTALLED_APPS setting.
then in the template:
{% load humanize %}
{{ price|intcomma }}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With