Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Need to get this calculator to round to 2 decimels

Reply
Thread Tools

Need to get this calculator to round to 2 decimels

 
 
Yonih
Guest
Posts: n/a
 
      09-10-2008
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>
 
Reply With Quote
 
 
 
 
Joshua Cranmer
Guest
Posts: n/a
 
      09-10-2008
Yonih wrote:
> 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.

--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth
 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      09-10-2008
On Sep 11, 1:12*am, Yonih <(E-Mail Removed)> wrote:
> Can anyone help me change this script to round to 2 decimals. *


That sounds like JavaScript you are referring to.

You have the wrong group.
<http://pscode.org/javafaq.html#js>

--
Andrew Thompson
http://pscode.org/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
So, round and round... 70-682... MSLearning, please read! DaGenester MCITP 2 05-20-2010 04:36 PM
reading file round and round cerr Perl Misc 6 03-20-2010 11:37 AM
VS2005 - Going round and round in circles again :) postings@alexshirley.com ASP .Net 0 06-22-2006 11:26 AM
Float.round - should it be round-to-even OliverMarchand Ruby 2 04-12-2006 12:06 PM
Computer Goes Round and Round Checking Alan Computer Support 6 10-08-2004 08:24 AM



Advertisments