function zeroPad(n, width) {
        var s = n.toString();
        var i = Math.max(width - s.length, 0);
        return new Array(i + 1).join("0") + s;
    }
Pad number with leading zeros. Does not support fractional or negative numbers.