Numbers localization in Web applications

前端 未结 8 720
渐次进展
渐次进展 2020-12-23 14:30

How can I set the variant of Arabic numeral without changing character codes ?

Eastern Arabic      ۰   ۱   ۲   ۳   ٦   ٥   ٤   ۷   ۸   ۹
Persian variant              


        
8条回答
  •  情深已故
    2020-12-23 15:12

    I imagine the best way is to use a regexp to search what numeric characters should be changed via adding a class name to the div that needs a different numeric set.

    You can do this using jQuery fairly easy.

    jsfiddle DEMO


    EDIT: And if you don't want to use a variable, then see this revised demo:

    jsfiddle DEMO 2

提交回复
热议问题