CFLib.org – Common Function Library Project

DiscountingInterest(p, r, t)

Last updated April 23, 2002
Download UDF

author

Stephan Scheele                                   Stephan Scheele

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

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

Return Values:
Returns a numeric value.

Example:

<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:

<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>

Search CFLib.org


Latest Additions

Jose Diaz-Salcedo Jose Diaz-Salcedo added
cfRssFeed
2 day(s) ago

Raymond Compton Raymond Compton added
structBlend
23 day(s) ago

Duncan Duncan added
IsZIPUK
23 day(s) ago

Todd Sharp Todd Sharp added
getTagContentAll
29 day(s) ago

Gerald Guido Gerald Guido added
ListReturnDuplicat...
1 month(s) ago

Created by Raymond Camden / Design by Justin Johnson