function Calculate() { var t1 = parseFloat(document.getElementById('<%= TextBoxTotalScoreAnc.ClientID%>').value); var t2 = parseFloat(document.getElementById('<%= TextBoxPossibleScoreAnc.ClientID%>').value); document.getElementById('<%= TextBoxOverallScoreAnc.ClientID%>').value = t1 / t2 * 100 + '%'; }
var n = 2.5689; alert(n.toFixed(2)); //ouput 2.56
Math.round
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)