以文本方式查看主题
- Foxtable(狐表) (http://foxtable.com/bbs/index.asp)
-- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2)
---- [求助]:英文金额大写问题 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=9908)
|
-- 作者:andy
-- 发布时间:2011/5/13 17:21:00
-- [求助]:英文金额大写问题
英文金额大写问题,例如:USD12345.45,我利用表达式计算,转换成大写后是:Twelve Thousand Three Hundred Forty Five Dollars And Forty Five Cents,但是正常的应该是:Twelve Thousand Three Hundred And Forty Five Dollars Forty Five Cents。
想请问各位高手,能否指导一下,解决这个问题。先谢谢了!!
[此贴子已经被作者于2011-5-13 17:48:08编辑过]
|
-- 作者:狐狸爸爸
-- 发布时间:2011/5/13 17:51:00
--
呵呵, 给你一个思路,找出转换后的最后一个Hundred,替换为Hundred And
|
-- 作者:狐狸爸爸
-- 发布时间:2011/5/13 17:57:00
--
Dim s1 As String = "Twelve Thousand Three Hundred Forty Five Dollars And Forty Five Cents" Dim n As Integer = s1.LastIndexOf("Hundred") Dim s2 As String = s1.Remove(n,7) s2 = s2.Insert(n,"Hundred And") Output.Show(s2)
|
-- 作者:blackzhu
-- 发布时间:2011/5/13 19:47:00
--
这个做法好像有问题,因为做外贸的要打发票,金额要转换成英文的.所以只是用于替换有问题的.
|
-- 作者:andy
-- 发布时间:2011/5/13 23:16:00
--
谢谢两位的帮忙。谢谢!
|
-- 作者:e-png
-- 发布时间:2011/5/14 8:41:00
--
Twelve Thousand Three Hundred Forty Five Dollars And Forty Five Cents,
Twelve Thousand Three Hundred And Forty Five Dollars Forty Five Cents。
这两句都有问题,英文金额大写必须 用类似:Say US Dollars .......而且 多少Cents 前面必须加 And(如;... and forty five cents)
|
-- 作者:blackzhu
-- 发布时间:2011/5/14 8:46:00
--
这个LXL版主不知道能不能搞定,这个做外贸很用的着?
|
-- 作者:lxl
-- 发布时间:2011/5/14 14:17:00
--
英语不太好,看看这个有没有问题,没问题我才改成VB的
Number:110200012.10 Word: One Hundred And Ten Million Two Hundred Thousand and Twelve Dollars And Ten Cents Number:200012105.42 Word: Two Hundred Million Twelve Thousand One Hundred And Five Dollars And Forty Two Cents Number:110105001.11 Word: One Hundred And Ten Million One Hundred And Five Thousand and One Dollars And Eleven Cents Number:100001001.42 Word: One Hundred Million One Thousand and One Dollars And Forty Two Cents Number:12020110.10 Word: Twelve Million Twenty Thousand One Hundred And Ten Dollars And Ten Cents Number:146010146.42 Word: One Hundred And Forty Six Million Ten Thousand One Hundred And Forty Six Dollars And Forty Two Cents Number:20120105.2 Word: Twenty Million One Hundred And Twenty Thousand One Hundred And Five Dollars And Twenty Cents Number:120105110 Word: One Hundred And Twenty Million One Hundred And Five Thousand One Hundred And Ten Dollars Number:105000005.2 Word: One Hundred And Five Million and Five Dollars And Twenty Cents Number:20020005 Word: Twenty Million Twenty Thousand and Five Dollars Number:146120105.11 Word: One Hundred And Forty Six Million One Hundred And Twenty Thousand One Hundred And Five Dollars And Eleven Cents Number:105120100.10 Word: One Hundred And Five Million One Hundred And Twenty Thousand One Hundred Dollars And Ten Cents Number:305305146.05 Word: Three Hundred And Five Million Three Hundred And Five Thousand One Hundred And Forty Six Dollars And Five Cents Number:105146305.10 Word: One Hundred And Five Million One Hundred And Forty Six Thousand Three Hundred And Five Dollars And Ten Cents Number:12305.05 Word: Twelve Thousand Three Hundred And Five Dollars And Five Cents Number:146146005 Word: One Hundred And Forty Six Million One Hundred And Forty Six Thousand and Five Dollars Number:305305000.10 Word: Three Hundred And Five Million Three Hundred And Five Thousand Dollars And Ten Cents Number:305012100.42 Word: Three Hundred And Five Million Twelve Thousand One Hundred Dollars And Forty Two Cents Number:10105110 Word: Ten Million One Hundred And Five Thousand One Hundred And Ten Dollars Number:110010020.2 Word: One Hundred And Ten Million Ten Thousand and Twenty Dollars And Twenty Cents Number:5005200.2 Word: Five Million Five Thousand Two Hundred Dollars And Twenty Cents Number:120020105.2 Word: One Hundred And Twenty Million Twenty Thousand One Hundred And Five Dollars And Twenty Cents Number:1146120 Word: One Million One Hundred And Forty Six Thousand One Hundred And Twenty Dollars Number:20305010 Word: Twenty Million Three Hundred And Five Thousand and Ten Dollars Number:100100105.11 Word: One Hundred Million One Hundred Thousand One Hundred And Five Dollars And Eleven Cents Number:120000020.11 Word: One Hundred And Twenty Million and Twenty Dollars And Eleven Cents Number:20200305 Word: Twenty Million Two Hundred Thousand Three Hundred And Five Dollars Number:1200120.2 Word: One Million Two Hundred Thousand One Hundred And Twenty Dollars And Twenty Cents Number:305010305.11 Word: Three Hundred And Five Million Ten Thousand Three Hundred And Five Dollars And Eleven Cents Number:305020012.11 Word: Three Hundred And Five Million Twenty Thousand and Twelve Dollars And Eleven Cents Number:10000001 Word: Ten Million and One Dollars
[此贴子已经被作者于2011-5-14 14:20:59编辑过]
|
-- 作者:lxl
-- 发布时间:2011/5/14 14:48:00
--
|
-- 作者:狐狸爸爸
-- 发布时间:2011/5/14 15:15:00
--
呵呵,收藏,单价确定lxl版主的正确的话,我找这个修改foxtable的代码。
|