//You can do this instead of using math.round! It is easier to understand using this function! var x = 5.0364342423; console.log(x.toFixed(2)); //result should be 5.04