Adding zeros when length is less
- by David
Is there a smart way to convert numbers to string and automatically add zeroes so the length is the same as the maximum?
like this:
for (var i=0; i<30; i++) {
var c = i.toString();
if (c.length == 1) {
c = '0'+=c;
}
}
But smarter