Calculator

Calculator

am 17.03.2010 05:07:43 von Karl DeSaulniers

--Apple-Mail-11-581371087
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
delsp=yes;
format=flowed

Hello,
I have been asked to see if I can set up an online calculator.
I was wondering if anyone had some pointers on where I can lear/find
a script that calculates percentages.
The regular math part I think I can figure out.
Its not a complicated calc, just basic math and percentages calc, a
payment calc if you will.
TIA

Karl DeSaulniers
Design Drumm
http://designdrumm.com


--Apple-Mail-11-581371087--

Re: Calculator

am 17.03.2010 05:22:12 von Kesavan Rengarajan

--0016367d674256739a0481f77583
Content-Type: text/plain; charset=ISO-8859-1

http://www.javascriptkit.com/script/cut18.shtml

JS based solution would be the easiest.

On Wed, Mar 17, 2010 at 3:07 PM, Karl DeSaulniers wrote:

> Hello,
> I have been asked to see if I can set up an online calculator.
> I was wondering if anyone had some pointers on where I can lear/find
> a script that calculates percentages.
> The regular math part I think I can figure out.
> Its not a complicated calc, just basic math and percentages calc, a payment
> calc if you will.
> TIA
>
> Karl DeSaulniers
> Design Drumm
> http://designdrumm.com
>
>

--0016367d674256739a0481f77583--

Re: Calculator

am 17.03.2010 05:24:38 von dmagick

Karl DeSaulniers wrote:
> Hello,
> I have been asked to see if I can set up an online calculator.
> I was wondering if anyone had some pointers on where I can lear/find
> a script that calculates percentages.
> The regular math part I think I can figure out.
> Its not a complicated calc, just basic math and percentages calc, a
> payment calc if you will.

loan payments? a bank website should have something like that. search
for "loan payment calculator" and you'll get tons of hits.

As for the maths behind it, I'm not sure.

--
Postgresql & php tutorials
http://www.designmagick.com/


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Calculator

am 17.03.2010 05:28:29 von Karl DeSaulniers

--Apple-Mail-12-582617622
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
delsp=yes;
format=flowed

This is close. All that functionality with ability to factor in say a
20% discount.

Thanks Kesavan

Karl


On Mar 16, 2010, at 11:22 PM, kesavan trichy rengarajan wrote:

http://www.javascriptkit.com/script/cut18.shtml

JS based solution would be the easiest.

On Wed, Mar 17, 2010 at 3:07 PM, Karl DeSaulniers
wrote:
Hello,
I have been asked to see if I can set up an online calculator.
I was wondering if anyone had some pointers on where I can lear/find
a script that calculates percentages.
The regular math part I think I can figure out.
Its not a complicated calc, just basic math and percentages calc, a
payment calc if you will.
TIA

Karl DeSaulniers
Design Drumm
http://designdrumm.com



Karl DeSaulniers
Design Drumm
http://designdrumm.com


--Apple-Mail-12-582617622--

Re: Calculator

am 17.03.2010 09:45:06 von Karl DeSaulniers

--Apple-Mail-15-598014126
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
delsp=yes;
format=flowed

Oh! I had gotten the zip file you sent though.
Ha, you must have "replied to all"

Well, thanks again. very nice I might add.

Karl


On Mar 17, 2010, at 3:12 AM, nagendra prasad wrote:

Sorry I was not aware that I can not send an attachment. Here is the
PHP calculator script:

function square( $number )
{
$newNumber = $number * $number;
return
$newNumber;
}
function cube( $number )
{
$newNumber = $number * $number * $number;
return
$newNumber;
}
?>






Calculator






To perform calculations such as squares, square roots, and
cubes you  need only fill in the first number field!



height="139">










if ($do == "+"){
if (($_POST['this'] != "") && ($_POST['that'] != "")) {
$result = $_POST['this'] + $_POST['that'];
}
else {
$message = "You did not fill in both fields!
";
$result = "N/A";
}
}
elseif ($do == "-"){
if (($_POST['this'] != "") && ($_POST['that'] != "")) {
$result = $_POST['this'] - $_POST['that'];
}
else {
$message = "You did not fill in both fields!
";
$result = "N/A";
}
}
elseif ($do == "*"){
if (($_POST['this'] != "") && ($_POST['that'] != "")) {
$result = $_POST['this'] * $_POST['that'];
}
else {
$message = "You did not fill in both fields!
";
$result = "N/A";
}
}
elseif ($do == "/"){
if (($_POST['this'] != "") && ($_POST['that'] != "")) {
$result = $_POST['this'] / $_POST['that'];
}
else {
$message = "You did not fill in both fields!
";
$result = "N/A";
}
}
elseif ($do == "^2"){
if ($_POST['this'] != "") {
$result = square ( $_POST['this'] );
$that = "";
}
else {
$message = "You did not fill in the first
field!
";
$result = "N/A";
}
}
elseif ($do == "SqRt"){
if ($_POST['this'] != "") {
$result = sqrt($_POST['this']);
$that = "";
}
else {
$message = "You did not fill in the first
field!
";
$result = "N/A";
}
}
elseif ($do == "^3"){
if ($_POST['this'] != "") {
$result = cube ( $_POST['this'] );
$that = "";
}
else {
$message = "You did not fill in the first
field!
";
$result = "N/A";
}
}
?>








 Calulator




type="text" name="that" size="10">








 

Result: echo($result); ?>

Powered by href="http://www.godfatheruk.com">GodfatherUK









Karl DeSaulniers
Design Drumm
http://designdrumm.com


--Apple-Mail-15-598014126--