I searched the Craft and Twig documentation, although I did not find any information about a logarithm function (http://php.net/manual/en/function.log.php ). I am trying to calculate the loan amortization formula below in Craft / Twig:
{% set payoffTime = -(ln(1 - ((128000 * '.05') / 1260)) / ln(1 + '.05')) %}
The numbers will be replaced with field handles once I can get the 'ln' function working. I'm not even sure if the formula is 'exactly' the way it should be yet - just trying to find a way to get logarithms working in Craft, and then go from there with testing, etc. :)
To give some background on the goal of this: it will calculate the amount of time it will take to pay off an amoritized loan, (mortgage, etc) based on the amounts the user has already submitted (loan amount, interest rate, extra payments, etc.) Also, this can't be done in Javascript - it needs to be in Craft since it's calculated from user data.
Thank you in advance for any info you can give about the logarithm function in Craft / Twig.
Thanks!