diff --git a/conservancy_beancount/reports/core.py b/conservancy_beancount/reports/core.py index 2c5aaf5096ad2f205e97e29f81276bd155c3aa47..aab80c13a4f5fd06afc83b69f0f55570d3dc34c8 100644 --- a/conservancy_beancount/reports/core.py +++ b/conservancy_beancount/reports/core.py @@ -167,11 +167,13 @@ class Balance(Mapping[str, data.Amount]): def ge_zero(self) -> bool: """Returns true if all amounts in the balance >= 0, within tolerance.""" - return self._all_amounts(operator.ge, -self.tolerance) + op_func = operator.gt if self.tolerance else operator.ge + return self._all_amounts(op_func, -self.tolerance) def le_zero(self) -> bool: """Returns true if all amounts in the balance <= 0, within tolerance.""" - return self._all_amounts(operator.le, self.tolerance) + op_func = operator.lt if self.tolerance else operator.le + return self._all_amounts(op_func, self.tolerance) def format(self, fmt: Optional[str]='#,#00.00 ¤¤',