Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment