如何将货币值转换为文本? [英] How to convert currency value to text?

查看:154
本文介绍了如何将货币值转换为文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

如何将我的货币值转换为文本。就像我得到价值$ 10383.50,然后它应该显示十万三百八十三美元五十美分。

Hi all,
how can i convert my currency value to text . Like if i get the value $10383.50,then it should show "Ten Thousand Three Hundred Eighty Three dollar fifty cents" .

推荐答案

10383.50,那么它应该显示万里三百八十三美元五十美分。
10383.50,then it should show "Ten Thousand Three Hundred Eighty Three dollar fifty cents" .


1.据我所知,.NET中没有自动转换功能这样做;



2.你可以实现这样做的算法,你应该在其中使用可以存储在你的应用程序资源中的文本(如One,Two,Ten,Eleven,Hundred等),然后在你的逻辑中应该根据其值及其在货币值中的位置选择正确的值。
1.As I know there is not automatically conversion function in .NET for doing this;

2.You could implement an algorithm for doing this, and you should use in it texts (like One, Two, Ten, Eleven, Hundred, etc) that could be stored in you application Resources, then in your logic should select the right one based on its value and its position in the currency value.


查找以下链接。它可以帮助你

http://www.vb-helper.com/howto_net_number_to_words2.html [ ^ ]
Find the below link. It may help you
http://www.vb-helper.com/howto_net_number_to_words2.html[^]

这篇关于如何将货币值转换为文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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