hi
im looking for some sort of php calculator...
like:
if i enter some value (suppose X value) into it.. it calculates 15% of that X value and add the result into X value..
for example..
X value = 230
it calculates like this 230 x 15% = 34.5
and it adds it back to X value.. in this case...
34.5 + 230 = 264.5
final result it must show is 264.5
nothing is to be changed.. only X value is variable and has to be changed everytime i want to calculate.
can u help me please? i want it urgent.
thanks
bye
REQ: some sort of calc
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: REQ: some sort of calc
Code: Select all
$percent = 15;
$x = 230;
$total = $x - ($x * ($percent / 100));(#10850)
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: REQ: some sort of calc
$x +arborint wrote:Code: Select all
$percent = 15; $x = 230; $total = $x - ($x * ($percent / 100));
instead of
$x -
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: REQ: some sort of calc
sorry but guys.. im totally a noob in programming.. can u guide me how to make this thing work on php ? 
so i dont have to put in percentage everytime.. i just enter the value and it shows the rslt!
so i dont have to put in percentage everytime.. i just enter the value and it shows the rslt!