def asIntOrDefault(v, default=None):
    """Answers v converted to int. Answer None if the conversion raised an
    error.

    >>> asIntOrNone(1234)
    1234
    >>> asIntOrNone('1234')
    1234
    >>> asIntOrNone('1234.2')
    1234
    >>> asIntOrNone('1234a') is None
    True
    """
    try:
        return int(round(float(v)))
    except (ValueError, TypeError):
        return default