格式化国际货币 [英] Format international currencies
问题描述
我有一个正在全球化"的 asp.net 应用程序,我将 currentculture 和 currentUICultre 设置为适当的值,并且货币按预期使用格式货币 ie 显示.
I have an asp.net application that we are in the process of "globalizing", I have the currentculture and currentUICultre being set to the appropriate values and currencies are displaying as expected using the format currency ie.
FormatCurrency(_nPrice)
产生
$xxx.xx 为 en-AU 和 £xxx.xx 为 en-GB,但是我们需要区分显示值的货币,而不是符号,因为很多货币使用美元符号.
$xxx.xx for en-AU and £xxx.xx for the en-GB, however we need to distinguish the currency of the value is being displayed in, other than the symbol because a lot of currencies use the dollar sign.
例如,我们需要为美国显示 US$123.12 或为澳大利亚显示 A$123.12.有没有像符号那样自动执行此操作的方法.
For example we need to display US$123.12 for the States or A$123.12 for Australia. Is there an automatic way of doing this like there is for the symbol.
任何建议将不胜感激.谢谢,
Any suggestions would be appreciated. Thank you,
推荐答案
RegionInfo 包含 ISOCurrencySymbol.由于您已经拥有 CurrentCulture,您可以执行以下操作:
The RegionInfo contains the ISOCurrencySymbol. Since you already have the CurrentCulture, You could do the following:
string currencySymbol = RegionInfo.CurrentRegion.ISOCurrencySymbol;
// currencySymbol equals EUR for France(fr-FR) or any EU country
// returns AUD for en-AU, US for en-US, etc.
这篇关于格式化国际货币的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!