kolor.js
function (number, width) {
            number += '';
            width -= number.length;
            if (width > 0) {
                return new Array(width + 1).join('0') + number;
            }
            return number + '';
        }
function (number, width) {
            number += '';
            width -= number.length;
            if (width > 0) {
                return new Array(width + 1).join('0') + number;
            }
            return number + '';
        }
function ( number , width ) { number += '' ; width -= number . length ; if ( width > 0 ) { return new Array ( width + 1 ) . join ( '0' ) + number ; } return number + '' ; }
Fills leading zeros for a number to make sure it has a fixed width.
Fills leading zeros for a number to make sure it has a fixed width .