Hi
I have a Web Form which I need to get results shown to 2 decimal points only.
In the Head I have: -
function heatoutput()
{
var vWidth=document.heatcalculator.roomwidth.value;
var vLength=document.heatcalculator.roomlength.value;
var vHeight=document.heatcalculator.roomheight.value;
var vRoomSize=vWidth*vLength*vHeight;
var rlength = 2
if(document.heatcalculator.calcunits.selectedIndex == 0)
{vRoomSize=vRoomSize*0.028368;}
document.heatcalculator.result.value=((vRoomSize / 14));
}
And the Form is: -
<FORM name="heatcalculator" method="post">
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="0" bgcolor="#CC0000">
<tbody>
<tr>
<td><table cellspacing="0" cellpadding="10" width="100%" border="0">
<tbody>
<tr>
<td><h1 class="Price_Special">Heat output calculator</h1>
<p class="Price_Special">Simply key in your room measurements, choose the correct units and click the "equals" button to find the heat output required to adequately heat your room.</p></td>
</tr>
<tr>
<td><div align="center"><strong class="Price_Special">Room measurements in:</strong>
<select name="calcunits">
<option value="feet">Feet</option>
<option value="metres" selected>Metres</option>
</select>
</div></td>
</tr>
<tr valign="center">
<td><div align="center" class="Price_Special"><strong>Length:
<input size="2" name="roomlength">
Width:
<input size="2" name="roomwidth">
Height:
<input size="2" name="roomheight">
</strong></div></td>
</tr>
<tr valign="center">
<td><div align="center" class="Price_Special"><strong><a href="javascript:heatoutput()"><img src="Images/equals.gif" alt="Click for result!" width="24" height="24" border="0" align="absBottom" class="Price_Special"></a>
<input size="10" name="result">
kW of heat output needed.</strong></div></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table>
</FORM>
How do I change this to show answer to 2 decimal points, please?
Many thanks.
Ianhen