var numb = 123.23454;
numb = numb.toFixed(2);
function roundTo2(num) {
return Math.round( ( num + Number.EPSILON ) * 100 ) / 100;
}
Number((6.688689).toFixed(2)); // 6.69
>>> parseFloat(0.9999999.toFixed(4));
1
>>> parseFloat(0.0009999999.toFixed(4));
0.001
>>> parseFloat(0.0000009999999.toFixed(4));
0