任何数字转换为中文货币类型(5)
来源:未知 责任编辑:责任编辑 发表时间:2014-01-06 18:18 点击:次
case 4: rstr = Convert4Digit(str); break;
}
rstr = rstr.Replace("拾零", "拾");
strlen = rstr.Length;
return rstr;
}
/// <summary>
/// 转换四位数字
/// </summary>
public string Convert4Digit(string str)
{
string str1 = str.Substring(0, 1);
string str2 = str.Substring(1, 1);
string str3 = str.Substring(2, 1);
string str4 = str.Substring(3, 1);
string rstring = "";
rstring += ConvertChinese(str1) + "仟";
rstring += ConvertChinese(str2) + "佰";
rstring += ConvertChinese(str3) + "拾";
rstring += ConvertChinese(str4);
rstring = rstring.Replace("零仟", "零");
rstring = rstring.Replace("零佰", "零");
rstring = rstring.Replace("零拾", "零");
rstring = rstring.Replace("零零", "零");
rstring = rstring.Replace("零零", "零");
rstring = rstring.Replace("零零", "零");
return rstring;
}
/// <summary>
/// 转换三位数字
/// </summary>
public string Convert3Digit(string str)
{
string str1 = str.Substring(0, 1);
string str2 = str.Substring(1, 1);
string str3 = str.Substring(2, 1);
string rstring = "";
rstring += ConvertChinese(str1) + "佰";
rstring += ConvertChinese(str2) + "拾";
rstring += ConvertChinese(str3);
rstring = rstring.Replace("零佰", "零");
rstring = rstring.Replace("零拾", "零");
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>