How can I view Arabic/Persian numbers in a HTML page with strict doctype?

后端 未结 10 1875
时光说笑
时光说笑 2020-12-18 19:26

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.

         


        
10条回答
  •  自闭症患者
    2020-12-18 19:53

    here is a little javascript code that converts a 1234 string to ١٢٣٤ string

       var map =
        [
        "&\#1632;","&\#1633;","&\#1634;","&\#1635;","&\#1636;",
        "&\#1637;","&\#1638;","&\#1639;","&\#1640;","&\#1641;"
        ];
    
        function getArabicNumbers(str)
        {
            var newStr = "";
    
            str = String(str);
    
            for(i=0; i

提交回复
热议问题