{% if whole_number and allow_mixed_numbers %}{{ whole_number }}{% endif %} {% if numerator and denominator %}<sup>{{ numerator }}</sup>&frasl;<sub>{{ denominator }}</sub>{% endif %}{% if whole_number == 0 and allow_mixed_numbers  %}{% if not numerator or not denominator %}{{ whole_number }}{% endif %}{% endif %}{% if whole_number == 0 and not allow_mixed_numbers %}{% if not numerator or not denominator %}<sup>{{ numerator }}</sup>&frasl;<sub>{{ denominator }}</sub>{% endif %}{% endif %}{# really nasty template logic due to lack of being able to group with parens in django templates #}
