I use the plugin jQuery Number Format to dynamically format numbers for both "," decimal and "." format. This works well on normal events. The issue I have is with dynamically added HTML, in which you use a delegate to fire the jQuery.
Normal
$('input.number').number( true, 2 );
If I use another ID that exists at runtime, such as #body, what is the proper way of calling it? I tried something like
$("#body").on("keyup", "input#number", function(event) {
$(this).number(true,2,',','.');
});
but it has problems with numbers on the right side of the decimal point. For instantance, if I try and type "450,45", the last hundreds digit is never used, additional numbers I type are placed in the 10s place.
Is there a proper way to do this?