title: How to convert Arabic number to English in input number?
body: <p>I have input type number and need to convert the numbers from Arabic to English once user trying to write: </p>
  
  <p>My wrong shut:</p>
  
  <pre><code>&lt;input type="number" class="arabicNumbers"&gt;
  </code></pre>
  
  <p>Jquery(js) code:</p>
  
  <pre><code>function toEnglishNumber(strNum) {
  
     var ar = [
         '٠','١','٢','٣','٤','٥','٦','٧','٨','٩',' ','-','/','|','~','٫'
     ];
  
     var en = [
         '0','1','2','3','4','5','6','7','8','9','','','','','','.'
     ];
  
     var cache = strNum;
  
     for (var i = 0; i &lt; 10; i++) {
         var regex_ar = new RegExp(ar[i], 'g');
         cache = cache.replace(regex_ar, en[i]);
     }
     return cache;
  }
  
  $(document).on('keyup', '.arabicNumbers', function() {
  
     toEnglishNumber($(this).val())
  
  });
  </code></pre>
  
  <p>Any suggestions or slove? </p>