refactor plneni time u indikatoru, v next upd

This commit is contained in:
David Brazda
2023-05-22 18:53:26 +02:00
parent 52870c0bd6
commit 8cf2956720
19 changed files with 846 additions and 74 deletions

View File

@ -124,12 +124,12 @@ def print(*args, **kwargs):
####ic(*args, **kwargs)
richprint(*args, **kwargs)
def price2dec(price: float) -> float:
def price2dec(price: float, decimals: int = 2) -> float:
"""
pousti maximalne 2 decimals
pokud je trojmistne a vic pak zakrouhli na 2, jinak necha
"""
return round(price,2) if count_decimals(price) > 2 else price
return round(price,decimals) if count_decimals(price) > decimals else price
def count_decimals(number: float) -> int:
"""