def byte_to_human(size):
    """Transform the size in bytes into the appropriate unit of measurement.

    :param int size: Size in bytes.

    :return: Actual size in B/KB/MB/GB.
    :rtype: str
    """
    try:
        size = int(size)
    except ValueError:
        return (0, "B")
    um = "B"
    if size < pow(2, 20):
        size = size / pow(2, 10)
        um = "KB"
    elif size < pow(2, 30):
        size = size / pow(2, 20)
        um = "MB"
    else:
        size = size / pow(2, 30)
        um = "GB"

    return (size, um)