1var int = 10;
2var float = parseFloat(int).toFixed(2);
3console.log(float); // 10.00
4var threedots = 8;
5var float2 = parseFloat(threedots).toFixed(3);
6console.log(float2); // 8.000
1var myNumber = 7;
2var formattedNumber = ("0" + myNumber).slice(-2);
3console.log(formattedNumber);