def npv(pval, payarray, rate, fromdayone):
    """ npv - Net Present Value
    """
    for i, payment in enumerate(payarray):
        pval -= payment / pow(1 + rate / (12 * 100.0), fromdayone + i)
    return pval
