Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - asp or javascript calculator?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

asp or javascript calculator?

 Post Reply Post Reply
Author
billd3 View Drop Down
Senior Member
Senior Member


Joined: 19 February 2003
Location: United States
Status: Offline
Points: 530
Post Options Post Options   Thanks (0) Thanks(0)   Quote billd3 Quote  Post ReplyReply Direct Link To This Post Topic: asp or javascript calculator?
    Posted: 10 March 2003 at 1:57pm

Greetings, all.

I've done a fair bit of looking around and from the sites and code I see here, this is the place to ask this.
I've been rebuilding my wife's site and she keeps getting the same question asked over and over and I thought that I had a clever idea - let them answer it themselves on her web site. They ask what she charges for her quilting services. She uses a simple formula:
Width A x Lenght B = C
C / 1296 = D (square yards)
D x $13 = charge (then of course we'd add the gov's share of taxes)
So, how hard would it be to put a quilting calculator on her site?
I've done a fair bit of VB scripting to automate software installs, AV updates and automated a lot of file server things with VBS, but that was long ago, and I've not done anything of this nature - I know there would need to be user input - the length in inches and the width in inches, then the script would run the formula and give them the results.

Thoughts???

Thanks,

Bill

BillD
http://theamcpages.com
http://theamcforum.com
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 10 March 2003 at 2:45pm
Well I am sure you want to have as little impact as possible for that so I think javascript would be the answer for you. This way you can have an immdiate result  without having the customer to hit a submit button or so. This calculator should be coming pretty close to what you want, so you would just have to adjust it to your formula http://www.scriptsearch.com/cgi-bin/jump.cgi?ID=7293
Back to Top
billd3 View Drop Down
Senior Member
Senior Member


Joined: 19 February 2003
Location: United States
Status: Offline
Points: 530
Post Options Post Options   Thanks (0) Thanks(0)   Quote billd3 Quote  Post ReplyReply Direct Link To This Post Posted: 11 March 2003 at 10:24pm

OK, I've come up with something and made some mods to make it REALLY close, however, I can't seem to figure out how to make it round to 2 decimal spots, as in money/cash/currency/dollars, etc.

It was giving out to about 8 places, I needed only .xx but comprimised by forcing it to round up. I'd like to make it actual dollars and cents (sorry to our U.K. friends, I only know U.S. money, not Pounds, etc.)
I'd like to remove the math.ceil part and make it round to xx.xx or just two spots past the dot.
Here's the code......
In the head, I have:
<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
function a_times_b(form) {
a=eval(form.a.value)
b=eval(form.b.value)
c=((a*b)/1296)*13
c=Math.ceil(c)
form.ans.value=c
}
// End -->
    </SCRIPT>
-----------
and in the body, the form:
<FORM name="formx">
<p align="left"><font face="Verdana" size="2"><b>Machine quilting  available.</b> <a name="quiltcalc"></a></font>
<font face="Verdana"><font size="2"></b><br>Enter length in inches here:</font>
</font>
<input type="number" size=4 value=84 name="a"></font><font size="2" face="Verdana"><br>
Enter width in inches here:&nbsp; </font>
<font face="Verdana">
<input type="number" size=4 value=75 name="b"></font><font size="2" face="Verdana"><br>
Click to calculate:
</font>
<font face="Verdana">
<input type="button" value="  Go  " onClick="a_times_b(this.form)"></font><font size="2" face="Verdana"> $ </font>
<font face="Verdana"><input type "number" value=0 name="ans" size=5><font size="2"><br>
</font>
<font size="1">Approx cost to quilt rounded to closest dollar.
<font color="#FF0000"><b>Minimum charge $40.00</b></font></font><font size="2"><br> </font>
<font size="1">(Batting and tax (if applicable) extra.) </font><font size="2">
<br>
</font></font></font><font face="Verdana" size="1">Email or call for details.</font></p>
</FORM>

BillD
http://theamcpages.com
http://theamcforum.com
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.