I am not a javascript coder so i apologize in advance but I have a formula that calculates off of 2 different inputs. My only problem is I want the result to be rounding to the nearest 100th. For example, the result may be something like 25.6789 and I would like it to calculate to 25.68 to only 2 decimal points and round it up to the nearest 100th.
Here is my current code:
<html>
<head>
<meta http-equiv=”Content-Language” content=”en-us”>
<meta http-equiv=”Content-Type” content=”text/html; charset=windows-1252″>
<meta name=”GENERATOR” content=”Microsoft FrontPage 6.0″>
<meta name=”ProgId” content=”FrontPage.Editor.Document”>
<title>TOC Calculator</title>
<script LANGUAGE=”JavaScript”>
<!– Begin
function calcLeaguePoints() {
var participantCount = document.leaguePoints.participantCount.value * 1;
var finish = document.leaguePoints.finish.value
answer =Math.sqrt(participantCount * 30) / (finish + 1)*10;
document.leaguePoints.answer.value = answer;
return true;
}
// End –>
</script>
<meta name=”Microsoft Theme” content=”tidepool 000″>
</head>
<body background=”file:///C:/Program%20Files/Microsoft%20FrontPage/themes/tidepool/”
bgcolor=”#CC9966″ text=”#000033″ link=”#660000″ vlink=”#CC0000″ alink=”#FF3300″>
<form name=”leaguePoints”>
<p> </p>
<div align=”center”><center><p>Use the calculator below to figure out your TOC points.
</p>
</center></div><div align=”center”><center><p><strong>Participants</strong> is the total
number of people in the Tourney.</p>
</center></div><div align=”center”><center><p><strong>Your finish</strong> is what
position you placed.</p>
</center></div><p> </p>
<div align=”center”><center><table>
<tr>
<td bgcolor=”#FFFFCC”><div align=”center”><center><p>Points
Calculator</p>
</center></div><table border=”0″>
<tr>
<td align=”right” bgcolor=”#FFFFCC”><font
face=”Verdana” size=”2″><b>Participants:</b></font></td>
<td bgcolor=”#FFFFCC”><font face=”Verdana”
size=”2″><input type=”text” name=”participantCount” SIZE=”5″ maxlength=”2″> </font></td>
</tr>
<tr>
<td align=”right” bgcolor=”#FFFFCC”><b><font
face=”Verdana” size=”2″>Your finish:</font></b></td>
<td bgcolor=”#FFFFCC”><font face=”Verdana”
size=”2″><input type=”text” name=”finish” size=”5″ maxlength=”2″> </font></td>
</tr>
<tr>
<td align=”center” colspan=”2″ bgcolor=”#FFFFCC”><font face=”Verdana” size=”2″><input type=”button”
value=”Calculate TOC Points” onclick=”calcLeaguePoints()”> </font></td>
</tr>
<tr>
<td bgcolor=”#FFFFCC”><div align=”right”><p><b><font
face=”Verdana” size=”2″>TOC points:</font></b> </td>
<td bgcolor=”#FFFFCC” align=”center”><font
face=”Verdana” size=”2″><input type=”text” name=”answer” size=”2″></font></td>
</tr>
</table>
</td>
</tr>
</table>
</center></div>
</form>
<p align=”center”> </p>
</body>
</html>