I need a percentage mask with the jQuery Mask Plugin v1.5.4
library.
What I'm trying to do is that the user can report a value from -99.99 to 99.99.
I'm trying like this:
$("#edtPercentual").mask("99,99%");
$("#edtPercentual").on("blur", function() {
var value = $(this).val().length == 1 ? $(this).val() + '%' : $(this).val();
$(this).val( value );
});
As you can see, it does not deal with much. How do I get negative and also how do I get "%" in any situation, in the above code the percentage does not appear when the value has two (2) decimal places.