Verified Commit 29f632c8 authored by Jakob Moser's avatar Jakob Moser
Browse files

Show or not show sign

parent c4d5a990
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -12,6 +12,9 @@ def parse_euro_amount(amount_str: str) -> Decimal:
        return Decimal(amount_without_sign.replace(",", ""))


def format_as_euro_de(amount: Decimal) -> str:
def format_as_euro_de(amount: Decimal, always_show_sign: bool = False) -> str:
    # TODO Move this somewhere more fitting
    return f"{amount}".replace(".", ",")
    if always_show_sign:
        return f"{amount:+.2f}".replace(".", ",")
    else:
        return f"{amount:.2f}".replace(".", ",")