从当前区域性获取货币? [英] Get the currency from current culture?

查看:108
本文介绍了从当前区域性获取货币?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法从应用区域性设置动态获取的最新信息?基本上,如果用户设定的文化,美国,我想知道货币是美元,如果他们有它设置为英国我想英镑等...等。

Is there a way to get current information dynamically from the apps culture settings? Basically if the user has set the culture to US I want to know the currency is dollars, or if they have it set to UK I want to pound sterling etc... etc..

这是这样我就可以将此信息发送到PayPal时,正在取得一个支付

This is so I can send this information to PayPal when a payment is being made

推荐答案

使用的RegionInfo.ISOCurrencySymbol属性。例如:

Use the RegionInfo.ISOCurrencySymbol property. For example:

  var ri = new RegionInfo(System.Threading.Thread.CurrentThread.CurrentUICulture.LCID);
  Console.WriteLine(ri.ISOCurrencySymbol);

输出:USD

这篇关于从当前区域性获取货币?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆