Javascript String commas()

Description

Javascript String commas()


String.prototype.commas = function() {
    return this.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")
}



PreviousNext

Related