Loading muffin/amount/AmountParser.py +5 −2 Original line number Diff line number Diff line Loading @@ -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(".", ",") Loading
muffin/amount/AmountParser.py +5 −2 Original line number Diff line number Diff line Loading @@ -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(".", ",")