我正在尝试将一种货币转换为另一种货币
例如。
decimal value= 0;
var text = "£135";
decimal.TryParse(text, NumberStyles.Any, new CultureInfo("fa-IR"), out value);
此结果值为“0”。我在这里做错什么了吗?
或者有没有其他方法可以做到这一点?
任何帮助表示赞赏!
更新
我累了
var value= string.Format(new CultureInfo("en-US"), "{0:c}", text);
then value = "£135"
var value = string.Format(new CultureInfo("en-US", false), "{0:c}", text);
then value = "£135"
var value = string.Format(new CultureInfo("en-US", false), "{0:c}", "135");
then value = "135"