dastylex Posted February 9, 2008 Share Posted February 9, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/90213-req-some-sort-of-calc/ Share on other sites More sharing options...
AndyB Posted February 9, 2008 Share Posted February 9, 2008 Urgent? OK? Show us the code you've already written and we'll get right on it for you. Quote Link to comment https://forums.phpfreaks.com/topic/90213-req-some-sort-of-calc/#findComment-462596 Share on other sites More sharing options...
sasa Posted February 10, 2008 Share Posted February 10, 2008 X value *= 1.15 Quote Link to comment https://forums.phpfreaks.com/topic/90213-req-some-sort-of-calc/#findComment-463420 Share on other sites More sharing options...
dastylex Posted February 11, 2008 Author Share Posted February 11, 2008 <tr> <td colspan="2"><table width="100%" border="3" cellpadding="15" cellspacing="0"> <tr> <td width="" valign="top" ><div align="center"><strong>Calculate Percent with this Percent Formula: <SCRIPT LANGUAGE="JavaScript" type="text/javascript"> </script> </strong> <SCRIPT LANGUAGE="JavaScript" type="text/javascript">function findpercent(form) { a = form.percentin.value/100; b = a*form.numberused.value; form.numberanswer.value = b; } </script> <SCRIPT LANGUAGE="JavaScript" type="text/javascript"> function calculatepercent(form) { a = form.numberin.value; b = form.numberintwo.value; c = a/b; d = c*100; form.answer.value = d; } </script> </div> <form action="calculate-percent-with-percentage-calculator.php" name=form1> <p></p> <p align="center"> <input name="percentin" type="text" class="regfont" size=6> % (Percent) of <input name="numberused" type="text" class="regfont" size=5> is: <p align="center"> <input type=button onClick="findpercent(this.form)" value="Calculate Percent"> <p align="center"> <strong>CALCULATION result: </strong> <input name="numberanswer" type="text" class="regfont" size=10> </p> </form></td> </tr> </table> </td> </tr> </table></td> i got this coding from some website.. it allows to calculate the percentage of the number.. but i want to modify it so it adds up the value with the answer of percentage. im totally a noob in programming.. so kindly.. if u can get me somthing? thanks Quote Link to comment https://forums.phpfreaks.com/topic/90213-req-some-sort-of-calc/#findComment-463922 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.