<html>
<body>
<p id="demo">Click the button to round different numbers to the nearest integer.</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction()
{
var a=Math.round(2.60);
var b=Math.round(2.50);
var c=Math.round(2.49);
var d=Math.round(-2.60);
var e=Math.round(-2.50);
var f=Math.round(-2.49);
var x=document.getElementById("demo");
x.innerHTML=a + "<br>" + b + "<br>" + c + "<br>" + d + "<br>" + e + "<br>" + f;
}
</script>
</body>
</html>