Currently this code outputs a string in two decimal places and I need it to be rounded to the closest integer. I had a play around with "math.round" but was unable to get it to work. Any assistance on this would be greatly appreciated!
function myFunction() {
var str = document.getElementById("blog-body").innerHTML;
var n = str.match(/(\w+)/g).length;
var x = n / 200;
var y = x.toFixed(2);
document.getElementById("result").innerHTML = y + ' Min |';
}
Thank you