Improved version of previous answer
function atLeast2Digit(n){_x000D_
n = parseInt(n); //ex. if already passed '05' it will be converted to number 5_x000D_
var ret = n > 9 ? "" + n: "0" + n;_x000D_
return ret;_x000D_
}_x000D_
_x000D_
alert(atLeast2Digit(5));
_x000D_