Possible Duplicate:
JavaScript equivalent to printf/string.format
How can I create a Zerofilled value using JavaScript?
I have a number in a variable:
var number = 5;
I need that number to be output as 05:
alert(number); // I want the alert to display 05, rather than 5.
How can I do this?
I could manually check the number and add a 0 to it as a string, but I was hoping there's a JS function that would do it?