def _string_to_bytes(s: str):
    """
    Convert string representation of disk space into bytes

    :param s: str
    :return: float
    """
    s = s.replace(' ', '')
    num, unit = s[:-1], s[-1]
    num = float(num)

    unit_multiplier = {
        'B': 1.0,
        'K': 1024.0,
        'M': 1024.0 * 1024.0,
        'G': 1024.0 * 1024.0 * 1000,
        'T': 1024.0 * 1024.0 * 1000 * 1000,
        'P': 1024.0 * 1024.0 * 1000 * 1000 * 1000,
    }

    if unit not in unit_multiplier:
        raise ValueError("unknown unit: {}".format(unit))

    multiplier = unit_multiplier[unit]

    bytes = num * multiplier
    return bytes