vj5 Posted October 15, 2007 Share Posted October 15, 2007 Can someone please help with a simple sample code to calculate compound interest with explanation? I guess the formula for compound interest is FV=P(1+r) to the number of years. FV is Future Value and P is Principal amount, r is the interest rate. I am not sure if the formula is correct. Link to comment Share on other sites More sharing options...
justsomeguy Posted October 15, 2007 Share Posted October 15, 2007 I'm not sure what language you want to do this in, but if you're using Javascript you can use Math.pow for the exponent:http://devguru.com/technologies/javascript/10754.aspPHP has a pow function to do the same thing:http://www.php.net/manual/en/function.pow.phpThere's nothing special to do for multiplication and addition, the + and * operators do those. Link to comment Share on other sites More sharing options...
vj5 Posted October 15, 2007 Author Share Posted October 15, 2007 I'm not sure what language you want to do this in, but if you're using Javascript you can use Math.pow for the exponent:http://devguru.com/technologies/javascript/10754.aspPHP has a pow function to do the same thing:http://www.php.net/manual/en/function.pow.phpThere's nothing special to do for multiplication and addition, the + and * operators do those.Thankyou. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.