简体   繁体   English

等同于CultureInfo.CurrentCulture.NumberFormat.CurrencySymbol的文本

[英]Text equivalent of CultureInfo.CurrentCulture.NumberFormat.CurrencySymbol

Is there a text equivalent of CultureInfo.CurrentCulture.NumberFormat.CurrencySymbol provided as a property in C#. 是否有等效的CultureInfo.CurrentCulture.NumberFormat.CurrencySymbol文本作为C#中的属性提供。

eg CultureInfo.CurrentCulture.NumberFormat.CurrencySymbol would give me $ but I want something textual like USD. 例如,CultureInfo.CurrentCulture.NumberFormat.CurrencySymbol会给我$,但是我想要文本之类的东西,例如USD。

You would use this: 您将使用此:

var name = System.Globalization.RegionInfo.CurrentRegion.ISOCurrencySymbol;

If you need the currency symbol for a specific region, you would use the RegionInfo 's constructor to specify a culture. 如果您需要特定区域的货币符号,则可以使用RegionInfo的构造函数来指定区域性。 For example, to always use en-US: 例如,要始终使用en-US:

var name = new System.Globalization.RegionInfo(1033).ISOCurrencySymbol;

or 要么

var name = new System.Globalization.RegionInfo("en-US").ISOCurrencySymbol;

Take a look at the MSDN documentation for more information. 查看MSDN文档以获取更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM