标题:求助!小写金额转换成大写
只看楼主
舞雪
Rank: 1
等 级:新手上路
威 望:1
帖 子:1786
专家分:0
注 册:2006-10-11
得分:0 
这么点代码还用design吗

呵呵,不愧是BC论坛
2006-11-26 19:03
noshow
Rank: 2
等 级:新手上路
威 望:4
帖 子:1127
专家分:0
注 册:2006-4-21
得分:0 
如果单单想达到楼主的目的

例如“113”转换成“壹壹叁”

这个就应该可以了吧?为什么要想那么复杂呢

public static string NumberChange(string xiao)
{
string dealed=xiao;
dealed=dealed.Replace ("1","壹");
dealed=dealed.Replace ("2","贰");
dealed=dealed.Replace ("3","叁");
dealed=dealed.Replace ("4","肆");
dealed=dealed.Replace ("5","伍");
dealed=dealed.Replace ("6","陆");
dealed=dealed.Replace ("7","柒");
dealed=dealed.Replace ("8","捌");
dealed=dealed.Replace ("9","玖");
dealed=dealed.Replace ("0","零");
return dealed;
}
public static string NumberChange(int xiao)
{
string dealed=xiao.ToString ();
dealed=dealed.Replace ("1","壹");
dealed=dealed.Replace ("2","贰");
dealed=dealed.Replace ("3","叁");
dealed=dealed.Replace ("4","肆");
dealed=dealed.Replace ("5","伍");
dealed=dealed.Replace ("6","陆");
dealed=dealed.Replace ("7","柒");
dealed=dealed.Replace ("8","捌");
dealed=dealed.Replace ("9","玖");
dealed=dealed.Replace ("0","零");
return dealed;
}

此号自封于2006年11月30日
2006-11-27 11:01



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-100302-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.204768 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved