Javascript Number LenWithZero(oCount)

Description

Javascript Number LenWithZero(oCount)


Number.prototype.LenWithZero = function(oCount) {
    var strText = this.toString();
    while (strText.length < oCount) {
        strText = '0' + strText;
    }//from w w w.j a  v a2 s . co  m
    return strText;
};



PreviousNext

Related