10 lines
288 B
Python
10 lines
288 B
Python
from __future__ import annotations
|
|
|
|
def money_fmt(value, currency: str = "EUR") -> str:
|
|
try:
|
|
v = float(value)
|
|
except Exception:
|
|
v = 0.0
|
|
# de-DE formatting (simple, stable)
|
|
return f"{v:,.2f} {currency}".replace(",", "X").replace(".", ",").replace("X", ".")
|