import decimal


def set_net(values, net=0, dp=6):
    """
    Take a list of values and make sure the sum is equal to net to the required dp
    If they are not, add the extra to the final value in the list.
    :param values: list of values
    :param net: the desired total of the list
    :param dp: the number of decimal places required
    :return: the list of updated values with the correct net value
    """

    decimal.getcontext().prec = dp
    new_values = [decimal.Decimal(str(val)) for val in values]
    extra = net - sum(new_values)
    if extra:
        new_values[-1] += extra

    return new_values