When dealing with the amount, it is usually necessary to output an upper-case form of the amount, which is a traditional Chinese Style. Hey hey, it also improves security.
There are many ways to write RMB in upper case. Today, I provide one for everyone to share.
Part Code Display:
Public static string Convert ( Decimal Number ){ Bool Negativeflag = False ; Decimal Rmbnumber; checknumberlimit (number); rmbnumber = Math . Round (number,2 ); // Set? 4? ? 5? Incoming? ? ? Small? Number? If (Rmbnumber = 0 ){ Return "Zero? Yuan? Whole? " ;} Else if (Rmbnumber <0 ) // Such? Result? Yes? Negative? Number? {Negativeflag = True ; Rmbnumber = Math . ABS (rmbnumber ); // Get? Absolutely? Right? Value? } Else {Negativeflag = False ;} String Buf = "" ; // Save? Put? ? ? End? Result? String Strdecpart = "" ; // Save? Put? Small? Number? Department? Points? ? ? Why? End? Result? String Strintpart = "" ; // Save? Put? Whole? Number? Department? Points? ? ? Why? End? Result? String [] TMP = Null ; String Strdigital = Rmbnumber . Tostring (); TMP = Strdigital . Split (cdelim, 2 ); // Set? Number? Data? Points? Is it? Whole? Number? And? Small? Number? Department? Points? If (Rmbnumber > = 1 m ) // Large? Yu? Hour? ? Yes? Yes? ? OK? Whole? Number? Department? Points? ? Transfer? Change? {Strintpart = Convertint (TMP [ 0 ]);} If (TMP . Length > 1 ) // Returns the decimal number. {Strdecpart = Convertdecimal (TMP [ 1 ]);} Else // If there is no decimal number, it must be an integer. {Strdecpart = "Whole" ;} If (Negativeflag = False ) // Yes? No? Negative? Number? {Buf = Strintpart + Strdecpart ;} Else {Buf = "Negative" + Strintpart+ Strdecpart ;} Return Buf ;}
The method is very simple:
Console.Writeline ("The capital amount corresponding to ¥12345.67 is :"+Deltacat.Net.RMB.Convert (12345.67 m));
DEMO code [C # convert lowercase to uppercase]