release: publish saldo 0.1.0
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
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} €"
|
||||
Reference in New Issue
Block a user