CSDN博客

img awcyy

将金额转换到大写数字的函数

发表于2004/6/25 12:53:00  503人阅读

//最大支持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