最佳实践 - 格式多种货币 [英] Best Practice - Format Multiple Currencies

查看:159
本文介绍了最佳实践 - 格式多种货币的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是下列情形的最佳实践?

What is best practice for the scenario listed below?

我们有我们愿意支持多币种的应用程序。该软件会尊重用户的本地化和区域设置决定了正确的数字格式,即$ 10,000.00或10.000,00₴等。

We have an application which we would like to support multiple currencies. The software will respect the users locale and regional settings to dictate the correct number format, i.e. $10,000.00 or 10.000,00₴ etc.

我们将不过希望能够格式化基于货币的ID(可能的三字母ISO4217码)不同的号码。我们的想法是为存储表中与每个货币数据库,然后从所述用户请求来选择将要使用的货币符号。然后程序会格式化基于区域/地区设置的所有电话号码,但会用在我们的程序中定义的货币符号。

We would however like to be able to format different numbers based upon a currency ID (perhaps the three letter ISO4217 code). Our idea is to store a table in the database with each currency and then request from the user to select the currency symbol which will be used. The program will then format all numbers based upon the locale/region setting but will use the currency symbol as defined in our program.

因此​​,考虑到以下值和货币

10000澳元

5989.34美元

450欧元

So, given the following values and currencies
10000 AUD
5989.34 USD
450 EUR

该计划将输出

$ 10,000.00

$ 5,989.34

€450.00

the program would output
$10,000.00
$5,989.34
€450.00

或与格式化数字作为一个区域设置#####,## $的结果将是;

$ 10000,00

$ 5989,34

450,00€

or with a regional setting that formated numbers as #####,##$ the result would be;
10000,00$
5989,34$
450,00€

尊重区域/地区的数字格式,但显示不同的货币,究竟是什么最佳做法?

Respecting locale/region number formatting but displaying different currencies, what is best practice for this?

我希望用这个是有道理的。

I hope this makes sense.

科技是C#.net 2.0。

Technology used is c# .NET 2.0.

推荐答案

我觉得这个Q是一个很好的和明确的答案,你应该做的。

I think this Q is an excellent and clear answer as to WHAT you should be doing

SO - 正确的货币格式时不显示文化

和这个问答有如何做到这一点在C#

And this Q has a good answer of HOW to do this in C#

SO - 货币格式

这篇关于最佳实践 - 格式多种货币的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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