Transfer from: http://blog.9cbs.net/yick/archive/2005/01/12/250097.aspx This is the source code of the class.
Namespace consoleapp {///
// Conversion Integer Private String Toint (String X) {INT LEN = X.LENGTH; String Ret, Temp; IF (LEN <= 4) Ret = Changeint (x); Else IF (LEN <= 8) {Ret = Changeint (X.Substring (0, LEN-4)) "10,000"; Temp = Changeint (X.Substring (LEN-4, 4)); if (Temp.indexof ("Thousand") == - 1 && Temp! = "") RET = "zero" Temp; Else Ret = Temp;} else {RET = Changeint (x.substring (0, len-8)) "100 million"; Temp = Changeint (x.substring LEN-8, 4)); IF (Temp.indexof ("Thousand") == - 1 && Temp! = "") RET = "Zero" Temp; Else Ret = Temp; RET = "Wan" Temp = Changeint (X.Substring (LEN-4, 4)); if (Temp.indexof ("Thousand") == - 1 && Temp! = "") RET = "Zero" Temp; Else Ret = Temp;} INT i; IF ((i = ret.indexof ("万"))! = - 1) Ret = RET.Remove (i 1, 1); while ((i = ret.indexof) Zero Zero "))! = - 1) RET = RET.Remove (I, 1); if (Ret [Ret.Length-1] == 'zero' && Ret.length> 1) RET = RET.REMOVE (RET .Length-1, 1); return return;} private string todaycimal (string x) {string Ret = ""; for (int i = 0; i Public String NumTochn (String X) {if (x.length == 0) Return ""; string rett = ""; if (x [0] == '-') {RET = "negative"; x = x. REMOVE (0, 1);} if (x [0] .tostring () == ".") X = "0" x; if (x [x.length-1] .tostring () == ". ") X = x.Remove (xLength-1, 1); if (x.indexof (". ")> - 1) RET = Toint (x.substring (0, x.indexof (". ") )) "Point" Todecimal (x.indexof (") 1)); Else Ret = toint (x); return ret;}}} This is the test engineering Using system; Namespace consoleapp {class mainclass {static void main (string [] args) {/ * system.console.writeline ("Hello, THE World!"); System.Console.writeline ("My Love!"); Classtest CT = new classtest (); system.console.writeline (ct.get_str ()); * / / * // Overload operator MyVector V1 = New MyVector (5, 12); MyVector V2 = New MyVector (4, 3); MyVector v3 = new myvector (); v3 = v1 v2; system.console.writeline ("{0} test", v3.length); * /