convert number to 2 digits javascript code example
Example 1: javascript round to 2 digits
var num = 2;
var roundedString = num.toFixed(2);// 2.00
Example 2: javascript two character integer
var myNumber = 7;
var formattedNumber = ("0" + myNumber).slice(-2);
console.log(formattedNumber);