I have this line of code which rounds my numbers to two decimal places. But I get numbers like this: 10.8, 2.4, etc. These are not my idea of two decimal places so how I can
Here's a simple one
function roundFloat(num,dec){ var d = 1; for (var i=0; i
Use like alert(roundFloat(1.79209243929,4));
alert(roundFloat(1.79209243929,4));
Jsfiddle