def in_words(amount, gender=None):
    """
    In-words representation of amount.

    Parameter is a gender: MALE, FEMALE or NEUTER

    Examples::
        {{ some_int|in_words }}
        {{ some_other_int|in_words:FEMALE }}
    """
    try:
        res = numeral.in_words(amount, getattr(numeral, str(gender), None))
    except Exception as err:
        # because filter must die silently
        res = default_value % {'error': err, 'value': str(amount)}
    return res
def in_words ( amount , gender = None ) : try : res = numeral . in_words ( amount , getattr ( numeral , str ( gender ) , None ) ) except Exception as err : res = default_value % { 'error' : err , 'value' : str ( amount ) } return res
In-words representation of amount.

    Parameter is a gender: MALE, FEMALE or NEUTER

    Examples::
        {{ some_int|in_words }}
        {{ some_other_int|in_words:FEMALE }}