from django import template

register = template.Library()

@register.filter
def cents_to_dollars(value):
    try:
        return "${:.2f}".format(int(value) / 100)
    except (ValueError, TypeError):
        return ''
