using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
/// <summary>
///money 的摘要说明
/// </summary>
public class money
{
public money()
{
//
//TODO: 在此处添加构造函数逻辑
//
}
private static string[] cstr = { "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" };
private static string[] wstr = { "", "", "拾", "佰", "仟", "万", "拾", "佰", "仟", "亿", "拾", "佰", "仟" };
public string ToChineseNumber(string strInt)
{
string str = strInt;
int len = str.Length;
int i;
string tmpstr, rstr;
rstr = "";
for (i = 1; i <= len; i++)
{
tmpstr = str.Substring(len - i, 1);
rstr = string.Concat(cstr[Int32.Parse(tmpstr)] + wstr[i], rstr);
}
rstr = rstr.Replace("拾零", "拾");
rstr = rstr.Replace("零拾", "零");
rstr = rstr.Replace("零佰", "零");
rstr = rstr.Replace("零仟", "零");
rstr = rstr.Replace("零万", "万");
for (i = 1; i <= 6; i++)
rstr = rstr.Replace("零零", "零");
rstr = rstr.Replace("零万", "零");
rstr = rstr.Replace("零亿", "亿");
rstr = rstr.Replace("零零", "零");
return rstr ;
}
}