by default when you use the
tag to create an ordered list you get something like:
1. . . 10. . . 100
...but is there a way to change
You need to use JavaScript for this.
function addzeros(number, length) {
var num = '' + number;
while (num.length < length) {
num = '0' + num;
}
return num;
}
alert(addzeros(100, 5))
Example usage
addzeros(1,3)
will give you 001
addzeros(10,3)
will give you 010
addzeros(100,0)
will give you 100
addzeros(100,6)
will give you 000100