如何在UWP中获取当前用户的货币符号 [英] How to get the currency symbol for current user in UWP

查看:101
本文介绍了如何在UWP中获取当前用户的货币符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Microsoft建议对UWP应用使用Windows.Globalization而不是System.Globalization(

Microsoft recommends using Windows.Globalization rather than System.Globalization for UWP apps (Use global-ready formats).

在Windows.Globalization.NumberFormatting命名空间下,有一个 CurrencyFormatter Class ,但我不想将数字格式化为货币.我想找到仅获取货币符号的方法.

Under Windows.Globalization.NumberFormatting Namespace there is a CurrencyFormatter Class but I do not want to format a number as currency. I want to find how to get the currency symbol only.

在UWP中为当前用户返回货币符号的当前最佳做法是什么?

What is current best practice for returning the currency symbol for the current user in UWP?

推荐答案

您可以使用

You can use the NumberFormatInfo.CurrencySymbol property for that:

string currencySymbol = NumberFormatInfo.CurrentInfo.CurrencySymbol;

这篇关于如何在UWP中获取当前用户的货币符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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