I just wrote this incredibly verbose code to turn numbers like 2 into 02. Can you make this function shorter, please (maintaning the functionality)?
"If anybody wants to post some extremely short equivalent in some other language, that would be fun too."
In javascript it is easy - paste this into your browser's address bar
javascript: function zit(n, w) {var z="000000000000000000"; return (z+n).substr(-w);} alert(zit(567, 9)); void(0);