reports: Balance tolerance can be an int.
This commit is contained in:
parent
a87d4bfc6c
commit
89bbf84347
1 changed files with 4 additions and 4 deletions
|
@ -100,7 +100,7 @@ class Balance(Mapping[str, data.Amount]):
|
|||
|
||||
def __init__(self,
|
||||
source: Iterable[data.Amount]=(),
|
||||
tolerance: Optional[Decimal]=None,
|
||||
tolerance: Optional[DecimalCompat]=None,
|
||||
) -> None:
|
||||
if tolerance is None:
|
||||
tolerance = self.TOLERANCE
|
||||
|
@ -179,12 +179,12 @@ class Balance(Mapping[str, data.Amount]):
|
|||
) -> bool:
|
||||
return all(op_func(amt.number, operand) for amt in self.values())
|
||||
|
||||
def copy(self: BalanceType, tolerance: Optional[Decimal]=None) -> BalanceType:
|
||||
def copy(self: BalanceType, tolerance: Optional[DecimalCompat]=None) -> BalanceType:
|
||||
if tolerance is None:
|
||||
tolerance = self.tolerance
|
||||
return type(self)(self.values(), tolerance)
|
||||
|
||||
def clean_copy(self: BalanceType, tolerance: Optional[Decimal]=None) -> BalanceType:
|
||||
def clean_copy(self: BalanceType, tolerance: Optional[DecimalCompat]=None) -> BalanceType:
|
||||
if tolerance is None:
|
||||
tolerance = self.tolerance
|
||||
return type(self)(
|
||||
|
@ -218,7 +218,7 @@ class Balance(Mapping[str, data.Amount]):
|
|||
sep: str=', ',
|
||||
empty: str="Zero balance",
|
||||
zero: Optional[str]=None,
|
||||
tolerance: Optional[Decimal]=None,
|
||||
tolerance: Optional[DecimalCompat]=None,
|
||||
) -> str:
|
||||
"""Formats the balance as a string with the given parameters
|
||||
|
||||
|
|
Loading…
Reference in a new issue