<script>
$(document).on('keyup', 'input.numberformat', function (event) {
// skip for arrow keys
if(event.which >= 37 && event.which <= 40) return;
input = $(this).val().replace(/\D/g, "") ? parseInt($(this).val().replace(/\D/g, ""), 10) : 0;
$($(this).data('target')).html(input === 0 ? '' : input.toLocaleString( "en-US" ));
});
</script>