【发布时间】:2013-02-12 07:14:12
【问题描述】:
我尝试设置 ASP.NET 应用程序的 Culture 和 UICulture,但没有成功。 还在 C# Windows 应用程序中尝试过。
System.Globalization.CultureInfo a = new System.Globalization.CultureInfo("fa-IR");
a.NumberFormat.DigitSubstitution = System.Globalization.DigitShapes.NativeNational;
string Q = string.Format(a, "{0}", 1234567890); // Output 1234567890 instead of ٠١٢٣٤٥٦٧٨٩
代码中有没有我遗漏的部分?
【问题讨论】:
-
如果您查看
DigitSubstitution属性的文档,您会发现它尚未使用(尚未):DigitSubstitution 属性保留供将来使用。目前,它不用于当前 NumberFormatInfo 对象的解析或格式化操作。
标签: c# asp.net .net vb.net cultureinfo