from __future__ import annotations from decimal import Decimal def currency(value: Decimal | float | int) -> str: amount = Decimal(str(value or 0)).quantize(Decimal("0.01")) formatted = f"{amount:,.2f}".replace(",", "_").replace(".", ",").replace("_", ".") return f"{formatted} €"