def to_int(val):
    """Convert val to int (or raise Exception)

    :param val: value to convert
    :type val:
    :return: int(float(val))
    :rtype: int
    """
    try:
        return int(val)
    except ValueError:
        return int(float(val))
