A algorithm for converting arabant digital to Chinese capital [C #]

xiaoxiao2021-03-06  110

http://blog.9cbs.net/fanz2000/archive/2004/08/16/76097.aspx

// Delicate some of the definition of the class private static string [] cstr = {"zero", "", "", "", "", "Wu", "柒", "捌" "," "}; Private static string [] wstr = {" "," "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "", "Pick", "", "仟"}; // number must be in a string // call mode within 12-bit integers, such as: label1.text = convertint ("digital string");

Public String Convertint (String Str) {INT LEN = Str.Length; INT I; String Tmpstr, RSTR; RSTR = ""; for (i = 1; i <= len; i ) {Tmpstr = Str.Substring (LEN- I, 1); rstr = string.concat (cstr [int32.parse (tmpstr)] WSTR [I], RSTR);}}}}}} = rstr.replace ("pick zero", "pick"); rstr = rstr.replace ("Zero Pickup", "Zero"); rstr = rstr.replace ("Zero", "Zero"); rstr = rstr.replace ("zero", "zero"); rstr = rtr.replace ("万 "," 10,000 "); for (i = 1; i <= 6; i ) rstr = rstr.replace (" zero zero "," zero "); rstr = rstr.replace (" 万 "," "R"); rstr = rstr.replace ("亿", "100 million"); rstr = rstr.replace ("zero zero", "zero"); rstr = "round";

Rstr = rstr.replace ("zero circle", "circle"); return RSTR;

转载请注明原文地址:https://www.9cbs.com/read-126093.html

New Post(0)