"""Transaction utilities.""" import decimal from decimal import Decimal _TWO_DECIMAL_PLACES = Decimal("1.00") def round_amount(amount: Decimal) -> Decimal: """Round a transfer amount to two decimal places. Args: amount (Decimal): Value to round. Returns: Decimal: The rounded value. """ return amount.quantize(_TWO_DECIMAL_PLACES, decimal.ROUND_HALF_EVEN)