Hi,
I would like to round the numbers in all of my text boxes to 2 decimal places. This is how the form works:
a user puts the quantity of an item in the boxes named tb13 and tb14. Onchange the value of textboxes named number13 and number14 are automatically calculated and put in the textboxes. number13 and number14 are then added and put in the text box named total.
All i need is for the numbers in the text boxes to be rounded to two decimal places.
Here is some code from my form: Thanks,
<input name="tb13" type="text" id="tb13" onchange="this.form['number13'].value=(this.value/1) * (this.form['peach-price'].value/1);this.form['total'].value=(this.form['total'].value)/1 + (this.form['number13'].value)/1;" value="0" size="1" />
$
<input name="number13" type="text" id="number13" size="5" readonly="" />
</label>
<input name="peach-price" type="hidden" id="peach-price" value="17.39" />
</span></td>
</tr>
<tr>
<td bgcolor="#FDF8EA"><span class="style8">Pumpkin Pecan Praline w/ vanilla flavored crust </span></td>
<td bgcolor="#FDF8EA"><span class="style8">Qty:</span> <span class="style8">
<label>
<input name="tb14" type="text" id="tb14" onchange="this.form['number14'].value=(this.value/1) * (this.form['peach-price'].value/1);this.form['total'].value=(this.form['total'].value)/1 + (this.form['number14'].value)/1;" value="0" size="1" />
$
<input name="number14" type="text" id="number14" size="5" readonly="" />
</label>
</span></td>
</tr>
<tr>
<td bgcolor="#FBEAB4"> </td>
<td bgcolor="#FBEAB4">_____________________</td>
</tr>
<tr>
<td bgcolor="#FDF8EA"><div align="right"><span class="style8">TOTAL:</span></div></td>
<td bgcolor="#FDF8EA"><label> $
<input name="total" type="text" id="total" size="5" readonly="" />
</label></td>
I would like to round the numbers in all of my text boxes to 2 decimal places. This is how the form works:
a user puts the quantity of an item in the boxes named tb13 and tb14. Onchange the value of textboxes named number13 and number14 are automatically calculated and put in the textboxes. number13 and number14 are then added and put in the text box named total.
All i need is for the numbers in the text boxes to be rounded to two decimal places.
Here is some code from my form: Thanks,
<input name="tb13" type="text" id="tb13" onchange="this.form['number13'].value=(this.value/1) * (this.form['peach-price'].value/1);this.form['total'].value=(this.form['total'].value)/1 + (this.form['number13'].value)/1;" value="0" size="1" />
$
<input name="number13" type="text" id="number13" size="5" readonly="" />
</label>
<input name="peach-price" type="hidden" id="peach-price" value="17.39" />
</span></td>
</tr>
<tr>
<td bgcolor="#FDF8EA"><span class="style8">Pumpkin Pecan Praline w/ vanilla flavored crust </span></td>
<td bgcolor="#FDF8EA"><span class="style8">Qty:</span> <span class="style8">
<label>
<input name="tb14" type="text" id="tb14" onchange="this.form['number14'].value=(this.value/1) * (this.form['peach-price'].value/1);this.form['total'].value=(this.form['total'].value)/1 + (this.form['number14'].value)/1;" value="0" size="1" />
$
<input name="number14" type="text" id="number14" size="5" readonly="" />
</label>
</span></td>
</tr>
<tr>
<td bgcolor="#FBEAB4"> </td>
<td bgcolor="#FBEAB4">_____________________</td>
</tr>
<tr>
<td bgcolor="#FDF8EA"><div align="right"><span class="style8">TOTAL:</span></div></td>
<td bgcolor="#FDF8EA"><label> $
<input name="total" type="text" id="total" size="5" readonly="" />
</label></td>