def convert_to_number(size):
    """Convert string to int.

    Args:
        size (str): String from yaml that represents a string with suffix
                    denoting how many bytes. suffix must be B, K, M, G or T
    Returns:
        num: (int) converted string number in bytes

    """
    num = 0
    SIZE_DICT = {"B": 1,
                 "K": 1024,
                 "M": 1024 * 1024,
                 "G": 1024 * 1024 * 1024,
                 "T": 1024 * 1024 * 1024 * 1024}
    # Convert string to bytes
    suffix = str(size)[-1]
    for key, value in SIZE_DICT.items():
        if suffix == key:
            num = int(value) * int(size[:-1])
    return int(num)