Capital | RMB converts the digital representation of the renminbi into capital letters (C # Edition)
There is no good to speak of, is a method, we take it
Using System;
Namespace test.com
{
<summary>
Function: string processing set of functions
</summary>
public class Dealstring
{
#region Private Members
<summary>
Input string
</summary>
private string Inputstring=null;
<summary>
Output string
</summary>
private string Outstring=null;
<summary>
Hint Information
</summary>
private string Notemessage=null;
#endregion
#region Public Properties
<summary>
Input string
</summary>
public string inputstring
{
Get{return inputstring;}
Set{inputstring=value;}
}
<summary>
Output string
</summary>
public string outstring
{
Get{return outstring;}
Set{outstring=value;}
}
<summary>
Hint Information
</summary>
public string Notemessage
{
Get{return Notemessage;}
Set{notemessage=value;}
}
#endregion
#region Constructors
Public dealstring ()
{
//
TODO: Add constructor logic here
//
}
#endregion
#region Public methods
public void Converttochinesenum ()
{
String numlist= "0 A three Woolu qi Ba Nine";
string rmblist = "cent of the points of the million thousand thousand million to pick up hundred thousand million";
Double number=0;
String Tempoutstring=null;
Try
{
Number=double. Parse (this.inputstring);
}
Catch
{
This.notemessage= "Incoming parameter not a number!" ";
Return
}
if (number>9999999999999.99)
This.notemessage= "The value of the people beyond the scope";
Converts a decimal number to an integer string
String Tempnumberstring=convert.toint64 (number*100). ToString ();
int tempnmberlength=tempnumberstring.length;
int i=0;
while (I<tempnmberlength)
{
int Onenumber=int32.parse (tempnumberstring.substring (i,1));
String onenumberchar=numlist.substring (onenumber,1);
String onenumberunit=rmblist.substring (tempnmberlength-i-1,1);
if (onenumberchar!= "0")
Tempoutstring+=onenumberchar+onenumberunit;
Else
{
if (onenumberunit== "billion" | | onenumberunit== "Million" | | onenumberunit== "Yuan" | | onenumberunit== "0")
{
while (Tempoutstring.endswith ("0"))
{
Tempoutstring=tempoutstring.substring (0,tempoutstring.length-1);
}
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.