Need to get this calculator to round to 2 decimels

Y

Yonih

Can anyone help me change this script to round to 2 decimals. Thanks
in advance


<FORM ACTION="..." METHOD="post">
<TABLE CELLSPACING="1" CELLPADDING="4">
<TR ALIGN="center" VALIGN="middle">
<TD><STRONG>Millimeters</STRONG></TD>
<TD>&nbsp;</TD>
<TD><STRONG>Inches</STRONG></TD>
<TD>&nbsp;</TD>
</TR>
<TR ALIGN="center" VALIGN="middle">
<TD><INPUT TYPE="text" NAME="milli" SIZE="12" VALUE="25.4"
onChange="inch.value = eval(this.value) / 25.4"></TD>
<TD>=</TD>
<TD><INPUT TYPE="text" NAME="inch" SIZE="12" VALUE="1.00"
onChange="milli.value = 25.4 * eval(this.value)"></TD>
<TD><INPUT TYPE="reset" VALUE="&nbsp;Reset&nbsp;"></TD>
</TR>
<TR ALIGN="center" VALIGN="middle">
<TD COLSPAN="3"><INPUT TYPE="button" VALUE="Convert"></TD>
<TD>&nbsp;</TD>
</TR>
</TABLE>
</FORM>
 
J

Joshua Cranmer

Yonih said:
Can anyone help me change this script to round to 2 decimals. Thanks
in advance


<FORM ACTION="..." METHOD="post">
<TABLE CELLSPACING="1" CELLPADDING="4">
<TR ALIGN="center" VALIGN="middle">
<TD><STRONG>Millimeters</STRONG></TD>
<TD>&nbsp;</TD>
<TD><STRONG>Inches</STRONG></TD>
<TD>&nbsp;</TD>
</TR>
<TR ALIGN="center" VALIGN="middle">
<TD><INPUT TYPE="text" NAME="milli" SIZE="12" VALUE="25.4"
onChange="inch.value = eval(this.value) / 25.4"></TD>
<TD>=</TD>
<TD><INPUT TYPE="text" NAME="inch" SIZE="12" VALUE="1.00"
onChange="milli.value = 25.4 * eval(this.value)"></TD>
<TD><INPUT TYPE="reset" VALUE="&nbsp;Reset&nbsp;"></TD>
</TR>
<TR ALIGN="center" VALIGN="middle">
<TD COLSPAN="3"><INPUT TYPE="button" VALUE="Convert"></TD>
<TD>&nbsp;</TD>
</TR>
</TABLE>
</FORM>

Right, you'll be wanting the javascript newsgroups.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top