var num = 1.42482;var num2 = 1;var fnum = Math.floor(num).toFixed(2);var fnum2 = Math.floor(num2).toFixed(2);console.log(fnum + " and " + fnum2); //both values will be 1.00
var num = new Number(14.12);console.log(num.toPrecision(2)); //outputs 14console.log(num.toPrecision(3)); //outputs 14.1console.log(num.toPrecision(4)); //outputs 14.12console.log(num.toPrecision(5)); //outputs 14.120