How can i convert English digits to Arabic digits?

前端 未结 7 805
有刺的猬
有刺的猬 2020-11-27 20:59

I have this C# code for example

DateTime.Now.ToString(\"MMMM dd, yyyy\");

Now the current thread is loading the Arabic culture. So the resu

7条回答
  •  情书的邮戳
    2020-11-27 21:49

    You can use the Windows.Globalization.NumberFormatting.NumeralSystemTranslator class to translate between the Latin and any of the supported numeral systems. To translate to Arabic, set the NumeralSystem property to "Arab", then you can call the TranslateNumerals method.

    Alternatively you can just use Windows.Globalization.DateTimeFormatting.DateTimeFormatter class directly.

提交回复
热议问题