function getfvss(savingsnow, years, i)
{
//uses Future Value of a Single Sum formula
 	var f = Math.pow((1+(i)),(years));
	var fv = savingsnow*f;
	return roundnumber(fv, 4);
}

function getpva(income, i, l)
{
//uses Present Value of an Annuity formula
	var v = Math.pow((1+(i/12)),-l*12);
	var pv=(income/12)*((1-v)/(i/12));
	return roundnumber(pv, 4);
}

function getfva(projectedneed, years2, i)
{
//uses Future Value of an Annuity formula
 	var a = Math.pow((1+(i)), (years2));
	var fva = a-1;
	var fvi = projectedneed*i;
	var ans2 = (roundnumber(fvi, 4)) * (1/roundnumber(fva,4));
	return roundnumber(ans2, 2);
}

function roundnumber(roundnum, rlength) {
	//var numberField = roundnum; // Field where the number appears
	//var rlength = 4;  The number of decimal places to round to
	var newnumber = Math.round(roundnum*Math.pow(10,rlength))/Math.pow(10,rlength);
	return newnumber;
}
