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: </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>