
Django
Add Leading Zeroes to Template Forloop Counter in Django
We can use the classic, {{ forloop.counter }} trick to output the number of the loop iteration (each time we go through the loop, it outputs that number), but it what if your designers want leading zeroes added to those numbers? Just to be clear these are numbers with leading zeroes: