public string returnResult(long num) { string numStr=num.ToString(); if(numStr.Length>8 && numStr.Length<16) { string[] split=new string[2]; split[0]=numStr.Substring(0,numStr.Length-8); split[1]=numStr.Substring(numStr.Length-8,8); string result1=getString(split[0])+"亿"; string result2=getString(split[1]); return result1+result2; } else { return getString(numStr); } } public string getString(string str) { if(str.Length>4) { string[] split=new string[2]; split[0]=str.Substring(0,str.Length-4); split[1]=str.Substring(str.length-4,4); string result1=getRe(split[0]); string result2=getRe(split[1]); if(!secondSplit[0].Equals("0000"))//确定是不是要加万 { result1+="万"; } return result1+result2; } else { return getRe(str); } } public string getRe(string doWith) { char[] number=doWith.ToCharArray(); int length=number.Length; string re=""; for(int i=0;i<length;i++) { switch(number[i]) { case '0': if(re.EndsWith("零")) { re+=""; } else { re+="零"; } break; case '1': re+="壹"; break; ~~~~~~~~~~~~~~~~~~~~~~~~ } int index=(int)Math.Pow(10,length-i-1); if(number[i].ToString=="0") { index=-1; } switch(index) { case 1000: re+="千"; break; case 100: re+="佰"; break; case 10: re+="拾"; break; } if(re.EndsWith("零")) { re=re.Substring(0,re.Length-1); } return re; }