Possible duplicate:
JavaScript equivalent to printf / string.format
How to create a Zerofilled value using JavaScript?
I have a number in a variable:
var number = 5;
I need this number to output as 05:
alert(number);
How can i do this?
I could manually check the number and add 0 to it as a string, but I was hoping there would be a JS function?
javascript math numbers digits
Nicekiwi Nov 11 2018-11-11T00: 00-11
source share