Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A little help with my script would we appreciated.
#1
Hey im making a script that calculates compound interest and everything should be working fine but when i run the script the answer is incorrect, i know the math is not wrong. Possibly the $I is automatically rounding off to a whole number (it is usually a decimal).

Anyway any help or tips would be appreciated.

Code:
<?php
/* This is the amount of money.
$P = $_POST["element_1"];
/* This is the % of interest (e.g. 18% is 0.18).
$I = $_POST["element_2"];
/* This is the time range.
$T = $_POST["element_3"];
/* This is to tell of any rests (e.g. monthly = 12, weekly = 52 and none = 1)
$K = $_POST["element_4"];
/* This is for the function below, its just T times K.
$N = $T*$K;

/* Heres the main function to find the compound interest.
$A = $P*(1+($I/$K))^$N;

print "Compound Interest is $A";
?>

Peace,

iPhish.
[Image: bleachsig101.gif]
WWW.BLASTDANIME.COM - STREAMING ANIME
MSN:monkeysondope@hotmail.com
Reply


Messages In This Thread
A little help with my script would we appreciated. - by Tasemu - 10-09-2009, 05:28 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  php form script with upload script help andrewjs18 4 3,340 10-07-2010, 11:46 AM
Last Post: JMK940

Forum Jump:


Users browsing this thread: 1 Guest(s)