Get the currency from current culture?

后端 未结 8 1370
渐次进展
渐次进展 2020-12-03 04:25

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

8条回答
  •  一向
    一向 (楼主)
    2020-12-03 04:46

    You can get the symbol from CultureInfo.CurrentCulture.NumberFormat.CurrencySymbol, but I doubt this is enough; you may need to maintain a separate list per culture. Or just let the user tell you what they want to pay in (for example, they might be away from home, etc, so the culture of the PC in some hotel lounge isn't what is on their credit card)

提交回复
热议问题