C # code for converting the RMB amount to uppercase in lower case

Source: Internet
Author: User

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]

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.