{% if i.stats %}
{% if i.stats.num_lookups > 0 %}
{# Can't jinja2 detect a division by zero and just do something intelligent? #}
{% set hit_percentage = 100 * i.stats.num_hits / i.stats.num_lookups %}
{% else %}
{% set hit_percentage = 0 %}
{% endif %}
Using {{ i.stats.bytes_used|filesizeformat }} ({{ i.stats.percent_used }}% of total space) for {{ i.stats.entries|numberfmt }} objects.
We've had {{ i.stats.num_hits|numberfmt }} hits out of {{ i.stats.num_lookups|numberfmt }} lookups ({{ hit_percentage|round(2) }}%).