Commit 4cfe84dc authored by Morten Welinder's avatar Morten Welinder
Browse files

Forgot to commit these for 1.6.

parent af8aa8d5
......@@ -1736,13 +1736,14 @@ gnumeric_pv (FunctionEvalInfo *ei, GnmValue const * const *argv)
gnm_float pmt = value_get_as_float (argv[2]);
gnm_float fv = argv[3] ? value_get_as_float (argv[3]) : 0;
int type = value_get_paytype (argv[4]);
gnm_float pvif, fvifa;
if (!is_valid_paytype (type))
return value_new_error_VALUE (ei->pos);
/* Calculate the PVIF and FVIFA */
gnm_float pvif = calculate_pvif (rate, nper);
gnm_float fvifa = calculate_fvifa (rate, nper);
pvif = calculate_pvif (rate, nper);
fvifa = calculate_fvifa (rate, nper);
if (pvif == 0)
return value_new_error_DIV0 (ei->pos);
......@@ -2007,12 +2008,13 @@ gnumeric_fv (FunctionEvalInfo *ei, GnmValue const * const *argv)
gnm_float pmt = value_get_as_float (argv[2]);
gnm_float pv = argv[3] ? value_get_as_float (argv[3]) : 0.;
int type = value_get_paytype (argv[4]);
gnm_float pvif, fvifa;
if (!is_valid_paytype (type))
return value_new_error_VALUE (ei->pos);
gnm_float pvif = calculate_pvif (rate, nper);
gnm_float fvifa = calculate_fvifa (rate, nper);
pvif = calculate_pvif (rate, nper);
fvifa = calculate_fvifa (rate, nper);
return value_new_float (-((pv * pvif) + pmt *
(1.0 + rate * type) * fvifa));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment