.net 将一串价格数字转化为中文大写形式
#region 数字转大写 public static string ToAmountWords(double money) { string temp = ""; string resu = ""; string jf = ""; int j = 0; int j_1 = 0; int jiao = 0; int fen = 0; int len = 0; List<string> Num = new List<string>() { "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" }; List<string> A = new List<string>() { "分", "角", "元", "拾", "佰", "仟", "万", "拾", "佰", "仟", "亿", "拾", "佰", "仟", "兆", "拾", "佰", "仟" }; temp = ((Math.Truncate(Math.Round(money * 100))).ToString()).Trim(); len = temp.Length; resu = ""; if (len > 13 || len == 0) return ""; jiao = Convert.ToInt32(temp.Substring(len - 2, 1)); fen = Convert.ToInt32(temp.Substring(len - 1, 1)); if (fen == 0) { if (jiao == 0) jf = "整"; else jf = Num[jiao] + "角整"; } else { if (jiao == 0) jf = "零" + Num[fen] + "分"; else jf = Num[jiao] + "角" + Num[fen] + "分"; } for (int i = 0; i < len - 2; i++) { j = Convert.ToInt32(temp.Substring(i, 1));//取第一位数字 if (j == 0) { j_1 = Convert.ToInt32(temp.Substring(i + 1, 1));//取第二位数字 if (j_1 == 0) continue; if (A[len - i - 1] == "萬" || A[len - i - 1] == "億") resu = resu + A[len - i - 1] + Num[j]; else { if (A[len - i - 1] == "元") resu = resu + "元"; else resu = resu + Num[j]; } } else resu = resu + Num[j] + A[len - i - 1]; } return resu + jf; } #endregion