从货币code得到的CultureInfo? [英] get CultureInfo from a Currency Code?
问题描述
我需要得到System.Globalization.CultureInfo不同的货币codeS。
I need to get the System.Globalization.CultureInfo for different Currency Codes.
例如:欧元,英镑,美元
Examples: EUR, GBP, USD
目前我在做基于这个3字母组成的货币code在switch语句中以下,显然这不是做的方式:
Currently I am doing the following inside a switch statement based on this 3 letter currency code, obviously this is not the way to do it:
var ci = new System.Globalization.CultureInfo("en-US");
任何人都有一个清洁的方式使用以达到相同的结果币code的呢?
Anyone have a clean way to achieve the same results using the currency code's instead?
推荐答案
短:这是不可能的。 EUR例如将映射到去DE,FR-FR,NL-NL等国家。有没有从货币文化的映射,因为多国共同货币。
Short: That's not possible. EUR for example would map to de-DE, fr-FR, nl-NL and other countries. There is no mapping from Currency to culture, because multiple countries share currencies.
这篇关于从货币code得到的CultureInfo?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!