I have an HTML page that is right-to-left. When I don\'t use any doctype, my numbers are in Arabic/Persian, but when I use strict mode they turn to English.
In case you need to replace some English to Arabic numerals and not the whole HTML, pass the number you need to this function.
function toArabicNumeral(en) { return ("" + en).replace(/[0-9]/g, function(t) { return "٠١٢٣٤٥٦٧٨٩".substr(+t, 1); }); }