CFLib.org – Common Function Library Project

DiscountingInterest(p, r, t)

Last updated April 23, 2002

Version: 1 | Requires: ColdFusion 5 | Library: FinancialLib

 
Rated 0 time(s). Average Rating: 0

Description:
Calculate the actual value of an amount by discounting the interest over n years.

Return Values:
Returns a numeric value.

Example:

view plain print about
<cfoutput>
$133.10 discounted at 10% over 1 year: #discountingInterest(0.1, 133.1, 1)#<br>
$133.10 discounted at 10% over 2 years: #discountingInterest(0.1, 133.1, 2)#<br>
$133.10 discounted at 10% over 3 years: #discountingInterest(0.1, 133.1, 3)#
</cfoutput>

Parameters:

Name Description Required
p Principal Yes
r Interest rate (0.03 = 3%) Yes
t Time in years. Yes

Full UDF Source:

view plain print about
<cfscript>
/**
 * Calculate the actual value of an amount by discounting the interest over n years.
 * 
 * @param p      Principal 
 * @param r      Interest rate (0.03 = 3%) 
 * @param t      Time in years. 
 * @return Returns a numeric value. 
 * @author Stephan Scheele (stephan@stephan-t-scheele.de) 
 * @version 1.0, April 23, 2002 
 */

function DiscountingInterest(r, p, t){
 return (p / (1 + r)^t);
}
</cfscript>
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Adam Cameron Adam Cameron added
composeDateTime
18 day(s) ago

Chris Weller Chris Weller added
convertQueryStri...
a while ago

Greg Nettles Greg Nettles added
arrayDiff
a while ago

Nathan Dintenfass Nathan Dintenfass added
ArrayOfStructsSo...
a while ago

Top Rated

Darwan Leonardo Sitepu backupDatabase
Rated 5.0, 36 time(s)

Barney Boisvert indentXml
Rated 5.0, 10 time(s)

Rachel Lehman deAccent
Rated 5.0, 6 time(s)

Isaac Dealey                                      countArbitraryDa...
Rated 5.0, 5 time(s)

Created by Raymond Camden / Design by Justin Johnson