i write this code to convert arabic number to english number when the user start typing inside testinput its working fine but how i can enable it to accepts negative value it's prevent me to type (-) on number inputs
jQuery(document ).on( "keyup", ".number", function(){
var yas =$(this).val();
yas = Number( yas.replace(/[٠١٢٣٤٥٦٧٨٩]/g, function(d) { return d.charCodeAt(0)-1632;}).replace(/[٠١٢٣٤٥٦٧٨٩]/g, function(d) {return d.charCodeAt(0) - 1776;}) );
if (isNaN (yas))
{yas= 0;}
$(this).val(yas);
});