def sanitise_p_value(n_iter, p_val):
    """
    Fixes p value too small or == 0 when computed form distribution
    (if not even 1 sample on the other side of measured value)

    :param int n_iter: The number of iterations that were performed to compute the distribution
    :param float p_val:
    :return:
    """
    if p_val == 0:
        p_val = "< {}".format(1 / n_iter)
    else:
        p_val = "{:.4f}".format(p_val)
    return p_val