def binary_to_hex(hex_format, binary_string) -> str:
    """
    Convert a binary string to a hexadecimal string.

    :param hex_format: hexadecimal format - "{0:0>X}" or "{0:0>2X}" etc.
    :param binary_string: binary string - for example, '1110'.
    :return: hexadecimal string - for example '0E', 'F'.
    """
    return hex_format.format(int(binary_string, 2))