const commafy = (val) => { try { return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); } catch (ex) { return val; } }; // commafy