Are you first timer at Why not join us and start exchange your programming knowledge with everyone. Register today!

jQuery - comma for price function

0 votes
added Jun 1, 2018 in jQuery by LC Marshal Captain (26,080 points)
edited Sep 20, 2018 by LC Marshal
//comma plugin
$.fn.digits = function(){ 
    return this.each(function(){ 
        $(this).text( $(this).text().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,") ); 

//comma for price on listing and area summary
$('.price-listing, .count-sale').digits();

Please log in or register to response this reference. - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.