/// <summary>
/// 数字转换中文繁体金钱
/// </summary>
/// <param name="Digital"></param>
/// <returns></returns>
public static string ConvertChineseMoney(decimal Digital)
{
string strChineseMoney = string.Empty;
//将小写金额转换成大写金额
String[] ArrMyScale = { "圆", "拾", "佰", "仟", "万", "拾", "佰", "仟", "亿", "拾", "佰", "仟", "兆", "拾", "佰", "仟" };
string[] ArrDecimalScale = { "角", "分", "厘", "毫" };
Dictionary<string, string> dicmybase = new Dictionary<string, string>();
dicmybase.Add("0", "零");
dicmybase.Add("1", "壹");
dicmybase.Add("2", "贰");
dicmybase.Add("3", "叁");
dicmybase.Add("4", "肆");
dicmybase.Add("5", "伍");
dicmybase.Add("6", "陆");
dicmybase.Add("7", "柒");
dicmybase.Add("8", "捌");
dicmybase.Add("9", "玖");
String[] MyBase = { "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" };
string moneyDigital = Digital.ToString();
string strmoneyint = Digital.ToString();
string strmoneyDecimal = string.Empty;
if (moneyDigital.IndexOf(".") != -1)
{
//moneyDigital = moneyDigital.Remove(moneyDigital.IndexOf("."), 1);
//isPoint = true;
strmoneyint = Digital.ToString().Substring(0, moneyDigital.IndexOf("."));
strmoneyDecimal = Digital.ToString().Substring(moneyDigital.IndexOf(".")+1);
strmoneyDecimal = strmoneyDecimal.TrimEnd('0');
}
//整数部分
if (!string.IsNullOrWhiteSpace(strmoneyint))
{
int intlength = strmoneyint.Length;
for (int count = 0; count <= intlength - 1; count++)
{
strChineseMoney += dicmybase[strmoneyint.Substring(count, 1)] + ArrMyScale[intlength - count-1];
}
}
//判断小数部分
if (!string.IsNullOrWhiteSpace(strmoneyDecimal))
{
int Decimallength = strmoneyDecimal.Length;
for (int count = 0; count <= Decimallength - 1; count++)
{
strChineseMoney += dicmybase[strmoneyDecimal.Substring(count, 1)] + ArrDecimalScale[count];
}
}
return strChineseMoney;
}