Here is a simpler form of the same thing. Should work fine in an ASP page. Notie you can round up or down getting the results you desire.
Code:
<html>
<body>
<script language="Javascript">
function custRound(x,places) {
if (document.calc.RoundOpt.value == "Up")
{
NewNum = (Math.ceil(x*Math.pow(10,places)))/Math.pow(10,places)
}
if (document.calc.RoundOpt.value == "Down")
{
places = 0
NewNum = (Math.floor(x*Math.pow(10,places)))/Math.pow(10,places)
}
alert(NewNum)
}
</script>
<form name="calc" method="POST">
<input type="text" name="T1" size="20" value="16.0001"><br>
<select size="1" name="RoundOpt">
<option selected value="Up">Up</option>
<option value="Down">Down</option>
</select>
<input type="button" value="Round Number" onClick="custRound(document.calc.T1.value,0)">
</form>
</body>
</html>