def convert_num(mode, num):
    """Converts a number in any given number scale

    Example:
    `convert_num("100K", 600000) returns 6`

    Args:
      - mode: (string) the scale for the conversion ("100K", "M", "10M", "100M", "B")
      - num: the number to be converted

    Returns:
      the converted number
    """

    num = int(num)

    if mode == "100K":
        num = int(num / 100000)
    elif mode == "M":
        num = int(num / 1000000)
    elif mode == "10M":
        num = int(num / 10000000)
    elif mode == "100M":
        num = int(num / 100000000)
    elif mode == "B":
        num = int(num / 1000000000)
    return num