function pad (n, width, z) { z = z || '0'; n = n + ''; while (n.length < width) { n = z + n; } return n; }