view_total = total; function addCommas(nStr){ nStr += ”; x = nStr.split(‘.’); x1 = x[0]; x2 = x.length > 1 ? ‘.’ + x[1] : ”; var rgx = /(\d+)(\d{3})/; while (rgx.test(x1)) { x1 = x1.replace(rgx, ‘$1’ + ‘,’ + ‘$2’); } return x1 + x2; } if( ‘number’ != typeof total ){ total = parseInt( total, 10 ); } total = total.toFixed(2); view_total = addCommas( total ); if( view_total.toString().length > 18 ){ view_total = Math.round( view_total ); } jQuery(‘#fld_5134095_1’).html( view_total ); jQuery(‘[data-field=”fld_5134095″]’).val( total ).trigger(‘change’); } jQuery(‘body’).on(‘change keyup’, ‘[data-field=”fld_7883756″],#conditional_fld_7883756’, function(e){ docalc_fld_5134095(); }); jQuery( document ).on(‘cf.remove cf.add’, function( e ){ docalc_fld_5134095(); }) docalc_fld_5134095(); });