def rounder(num, digits=None):
    """Round a floating point number to given number of digits after the
    decimal point.

    Parameters
    ----------
    num : float
        Number to round.
    digits : int, optional
        Digits after the decimal point.

    Returns
    -------
    int or float
        Rounded number.

    See Also
    --------
    initize

    Notes
    -----
    Variant of `intize`, allowing rounding to custom decimal precision.
    """
    near = round(num * 2, digits) / 2
    if abs(num - near) <= (1e-7 / 10 ** digits if digits else 1e-7):
        return round(near, digits)
    else:
        return round(num, digits)