from decimal import Decimal
from typing import Union

from django.template.defaultfilters import register


@register.filter(name="euro")
def euro(value: Union[int, float, Decimal]):
    if not value:
        return "-"
    return f"{value:.2f} €"
