CSDN博客

img awcyy

一个将小写金额转换为大写的C#函数

发表于2004/6/25 12:36:00  680人阅读

//最大支持99,999,999.99元
private string ChMoney(float Money)
{
?string[] MChar={"零","壹","贰","叁","肆","伍","陆","柒","捌","玖"};
?string[] MUnit = {"分","角","元","拾","佰","仟","万","拾","佰","仟"};
?string strMoney = ((long)(Money * 100)).ToString();
?string outMoney = "";
?for(int i = 0;i < strMoney.Length;i++)
?{
??outMoney += MChar[int.Parse(strMoney.Substring(i,1))] + MUnit[strMoney.Length - i - 1];
?}
?return outMoney;
}
0 0

相关博文

我的热门文章

img
取 消
img