【C# 大写金额转阿拉伯数字】大写金额转数值
public string DealNum(string num) { string ReturnNum = ""; switch (num) { case "零": ReturnNum = "0"; break; case "壹": ReturnNum = "1"; break; case "贰": ReturnNum = "2"; break; case "叁": ReturnNum = "3"; break; case "肆": ReturnNum = "4"; break; case "伍": ReturnNum = "5"; break; case "陆": ReturnNum = "6"; break; case "柒": ReturnNum = "7"; break; case "捌": ReturnNum = "8"; break; case "玖": ReturnNum = "9"; break; } return ReturnNum; }
1 /// <summary> 2 /// 处理单位 3 /// </summary> 4 /// <param name="Unit"></param> 5 /// <returns></returns> 6 public int DealUnit(string Unit) 7 { 8 int unitnum = 1; 9 switch (Unit) 10 { 11 case "拾": 12 unitnum = 10; 13 break; 14 case "佰": 15 unitnum = 100; 16 break; 17 case "仟": 18 unitnum = 1000; 19 break; 20 case "百": 21 unitnum = 100; 22 break; 23 case "千": 24 unitnum = 1000; 25 break; 26 case "万": 27 unitnum = 10000; 28 break; 29 case "亿": 30 unitnum = 100000000; 31 break; 32 } 33 return unitnum; 34 }
部分代码
需要的小伙伴 可留言
你永远不懂我伤悲、就好像白天不懂夜的黑··