Created
September 10, 2010 12:41
-
-
Save atuttle/573566 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
numeric function getPeriods(required numeric initBalance, required numeric intRate, required numeric desiredTotal) output="false" { | |
//assume interest rate is of format .5 = 50% | |
var periods = (log(arguments.desiredTotal) - log(arguments.initBalance))/log(1+arguments.intRate); | |
return (ceiling(periods)); | |
} | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment