【问题标题】:Format international currencies格式化国际货币
【发布时间】:2009-05-06 21:04:07
【问题描述】:

我有一个我们正在“全球化”过程中的 asp.net 应用程序,我将 currentculture 和 currentUICultre 设置为适当的值,并且使用货币 ie 格式按预期显示货币。

FormatCurrency(_nPrice)

产生

$xxx.xx 代表 en-AU 和 £xxx.xx 代表 en-GB,但是我们需要区分显示值的货币,而不是符号,因为很多货币都使用美元符号.

例如,我们需要为美国显示 123.12 美元或为澳大利亚显示 123.12 澳元。有没有像符号一样自动执行此操作的方法。

任何建议将不胜感激。谢谢,

【问题讨论】:

    标签: asp.net vb.net


    【解决方案1】:

    RegionInfo 包含 ISOCurrencySymbol。由于您已经拥有 CurrentCulture,您可以执行以下操作:

    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.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-08-20
      • 2018-04-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-08
      • 2016-04-25
      相关资源
      最近更新 更多