This is an algorithm to format the amounts wrote in jQuery:
But, there are some bugs.
For example, if I write 900.800,00 and then I delete "9" the import remains 00.800,00. How can I fix it? I fixed many bug but I don't know how to fix this.
Another bug arrives from:
$(this).on("dragstart", function(e) {
     return false;
});
It is used to prevent the drag the text inside the input field. But, after an AJAX call this not works more. 
I should use something like $(document).on, but how exactly?
Can you find other bugs? Thank you!
 
     
     
     
    