def rounder(x, ndigits):
    """Round a number, or sequence of numbers, to a specified number of decimal digits

    Args:
        x (None, float, complex, list): The number or sequence of numbers to be rounded. If the
            argument is None, then None will be returned.
        ndigits (int): The number of decimal digits to retain.

    Returns:
        None, float, complex, list: Returns the number, or sequence of numbers, with the requested
            number of decimal digits. If 'None', no rounding is done, and the function returns
            the original value.
    """
    if ndigits is None:
        return x
    elif x is None:
        return None
    elif isinstance(x, complex):
        return complex(round(x.real, ndigits), round(x.imag, ndigits))
    elif isinstance(x, float):
        return round(x, ndigits)
    elif hasattr(x, '__iter__'):
        return [rounder(v, ndigits) for v in x]
    return x