js commafy number

علی ذوالفقار
1402/10/26 21:39:24 (24)
const commafy = (val) => {
    try {
        return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
    } catch (ex) {
        return val;
    }
}; // commafy        
Back