def get_as_int(store, key, default):
    """ Return the value for key as integer from a dictionary, else default """
    try:
        value = store.get(key, default)
        return int(value)
    except (ValueError, TypeError):
        return default