Author Topic: How to turn this Formula Into script form  (Read 521 times)

Im not much of a scripter. But im writing up a bank interest formula for a mod. here is the Math Formula for Bank value :



The input is Initial bank value, and the output value is final bank value after 1 unit of time.

If anyone could help me write this in script form to be used in a mod, that would be excellent.

Thank you,

Only1rebel
« Last Edit: October 24, 2008, 10:31:23 PM by Only1rebel »

Code: [Select]
function addBankInterest(%money)
{
 return %money + %money * (0.316228 / mSqrt(%money));
}

Every unit of time, set each bank account's value to addBankInterest(%moneyInAccount);.