old_contents: from django.template import Node, Library
  
  register = Library()
  
  @register.filter('percentage')
  def percentage(value, total):
    try:
      percentage = int(value) / int(total) * 100
    except ZeroDivisionError:
      percentage = 0
    return '<abbr title="%s/%s">%s%%</abbr>' % (value, total, percentage)
  
new_contents: from django.template import Node, Library
  
  register = Library()
  
  @register.filter('percentage')
  def percentage(value, total):
    try:
      percentage = float(value) / float(total) * 100
    except ZeroDivisionError:
      percentage = 0
    return '<abbr title="%s/%s">%s%%</abbr>' % (value, total, percentage)
  
subject: Fix % only showing 0 or 100%, everything between goes to 0%.