Skip to content

Instantly share code, notes, and snippets.

@atuttle
Created September 10, 2010 12:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atuttle/573566 to your computer and use it in GitHub Desktop.
Save atuttle/573566 to your computer and use it in GitHub Desktop.
<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