import decimal


def convert_decimal_to_int(obj):
    """
    Amazon DynamoDB returns numbers in Python Decimal format, which are converted to
    float by the JSON serializer. This function instead converts them to int.
    Pass this function to the `json.dumps` function for custom conversion.

    :param obj: The current object being deserialized.
    :return: When obj is a Decimal, return it as an int.
    """
    if isinstance(obj, decimal.Decimal):
        return int(obj)