private static string[] cstr = { "", "", "", "", "", "", "", "", "", "" };
private static string[] wstr = { "", "", "", "", "", "", "", "", "", "", "", "" };

/// <summary>
/// 数字转化为大写中文
/// </summary>
/// <param name="strNumber"></param>
/// <returns></returns>
public string ToUpperStr(string strNumber)
{
int intLength = strNumber.Length;
string strTemp = "";
string strResult = "";

for (int i = 0; i < intLength;i++ )
{
strTemp
= strNumber.Substring(intLength - i - 1, 1);
strResult
= String.Concat(cstr[Int32.Parse(strTemp)] + wstr[i], strResult);
}

strResult
= strResult.Replace("拾零", "");
strResult
= strResult.Replace("零拾", "");
strResult
= strResult.Replace("零佰", "");
strResult
= strResult.Replace("零仟", "");
strResult
= strResult.Replace("零萬", "");

for (int i = 1; i <= 6;i++ )
{
strResult
= strResult.Replace("零零", "");
}

strResult
= strResult.Replace("零萬", "");
strResult
= strResult.Replace("零億", "");
strResult
= strResult.Replace("零零", "");

return strResult;
}

 

相关文章:

  • 2022-12-23
  • 2021-10-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-04
  • 2021-12-31
猜你喜欢
  • 2018-07-12
  • 2021-05-26
  • 2022-12-23
  • 2022-12-23
  • 2021-12-11
  • 2021-11-18
相关资源
相似解决方案