Net RMB capital, net RMB capital

Source: Internet
Author: User

Net RMB capital, net RMB capital

/***
** HongShijin
** Me@HongShijin.com
** 10:13:00. 00000
** Text/C #
***/

/// <Summary>
/// Convert the RMB into uppercase
/// </Summary>
/// <Param name = "input"> digital input </param>
/// <Returns> capital amount </returns>
Public static string ToSuperRMB (object input)
{
Var d = decimal. Zero;
If (input = null)
Return ToSuperRMB (d );

If (input is decimal)
Return ToSuperRMB (decimal) input );

If (input is double)
Return ToSuperRMB (new decimal (double) input ));

If (input is float)
Return ToSuperRMB (new decimal (float) input ));

If (input is int)
Return ToSuperRMB (new decimal (int) input ));

If (input is long)
Return ToSuperRMB (new decimal (long) input ));

If (input is uint)
Return ToSuperRMB (new decimal (uint) input ));

If (input is ulong)
Return ToSuperRMB (new decimal (ulong) input ));

If (decimal. TryParse (input. ToString (), out d ))
Return ToSuperRMB (d );

Return input. ToString (); // return ToSuperRMB (d );//
}

/// <Summary>
/// Convert the RMB into uppercase
/// </Summary>
/// <Param name = "input"> digital input </param>
/// <Returns> capital amount </returns>
Public static string ToSuperRMB (ulong input)
{
Return ToSuperRMB (new decimal (input ));
}

/// <Summary>
/// Convert the RMB into uppercase
/// </Summary>
/// <Param name = "input"> digital input </param>
/// <Returns> capital amount </returns>
Public static string ToSuperRMB (uint input)
{
Return ToSuperRMB (new decimal (input ));
}

/// <Summary>
/// Convert the RMB into uppercase
/// </Summary>
/// <Param name = "input"> digital input </param>
/// <Returns> capital amount </returns>
Public static string ToSuperRMB (long input)
{
Return ToSuperRMB (new decimal (input ));
}

/// <Summary>
/// Convert the RMB into uppercase
/// </Summary>
/// <Param name = "input"> digital input </param>
/// <Returns> capital amount </returns>
Public static string ToSuperRMB (int [] input)
{
Return ToSuperRMB (new decimal (input ));
}

/// <Summary>
/// Convert the RMB into uppercase
/// </Summary>
/// <Param name = "input"> digital input </param>
/// <Returns> capital amount </returns>
Public static string ToSuperRMB (int input)
{
Return ToSuperRMB (new decimal (input ));
}

/// <Summary>
/// Convert the RMB into uppercase
/// </Summary>
/// <Param name = "input"> digital input </param>
/// <Returns> capital amount </returns>
Public static string ToSuperRMB (float input)
{
Return ToSuperRMB (new decimal (input ));
}

/// <Summary>
/// Convert the RMB into uppercase
/// </Summary>
/// <Param name = "input"> digital input </param>
/// <Returns> capital amount </returns>
Public static string ToSuperRMB (double input)
{
Return ToSuperRMB (new decimal (input ));
}

/// <Summary>
/// Convert the RMB into uppercase
/// </Summary>
/// <Param name = "input"> digital input </param>
/// <Returns> capital amount </returns>
Public static string ToSuperRMB (decimal input)
{
Var n = "";
Var u = ""; // "zookeeper picks up the amount of data in the Beijing region and picks up the amount of data in the Shanghai region. The amount of data collected by hundreds of millions of workers is tens of thousands of workers"
Var m = input;
If (m> decimal. Zero)
M * = 10000 M;
Else
M * =-10000 M;
Var t = m. ToString ("0 ");
If (t = "0 ")
Return "Zero circle ";

If (t. Length> u. Length)
Throw new ArgumentOutOfRangeException ();

U = u. Substring (u. Length-t. Length );
For (var I = t. Length-1; I> = 0; I --)
T = t. Remove (I) + n [t [I]-'0'] + u [I] + t. Substring (I + 1 );
T = Regex. replace (t, "zero + [^ ]", "zero", RegexOptions. compiled ); // t = "One Shard, zero Shard, zero shard ";
T = Regex. replace (t, "zero {2,}", "zero", RegexOptions. compiled); // t = ""
T = Regex. replace (t, "zero + ([])", "$1", RegexOptions. compiled); // t = ""
T = Regex. replace (t, "([]) [] +", "$1", RegexOptions. compiled); // t = """
T = Regex. replace (t, "^ [] +", string. empty, RegexOptions. compiled); // ""
If (t [0] = '0 ')
T = t. Substring (1 );
If (t [t. Length-1] = '0 ')
T = t. Remove (t. Length-1 );
If (t [t. Length-1] = 'circle ')
T = t + "whole ";
If (input> = decimal. Zero)
Return t;

Return "accept" + t; // negative
}


Tutorial: RMB 108060 in accounting

RMB 1 million RMB 1 million RMB 0 RMB

Well, I am not clear at the beginning. I have read www.km169.net/kmboc/zsh/piaoju.htm, and I always know a general idea.
Reference: www.km169.net/kmboc/zsh/piaoju.htm

Use VBNET to convert the case sensitivity of RMB (mutual conversion)

Public Function je (ByVal szje As Double) As String
Dim s As String = ""
Dim sz () As String = {"zero", "one", "two", "three", "Si", "Wu", "Lu", "Lu ", "success", "fail "}
Dim dw () As String = {"circle", "pick up", "yellow", "thousands", "Ten Thousand", "pick up", "yellow", "yellow ", "Pick up", "success", "fail "}
If szje <0 Then
S = "negative"
Szje = Math. Abs (szje)
End If
Dim zh () As String = Split (Str (szje ),".")
If zh. Length> 2 Then
Return "ERROR: Format ERROR"
Exit Function
End If
Zh (0) = Trim (zh (0 ))
Zh (1) = Trim (zh (1 ))
Dim I As Integer
For I = 1 To Len (zh (0 ))
S = s & sz (Val (Mid (zh (0), I, 1) & dw (Len (zh (0)-I)
Next
For I = 1 To Len (zh (1 ))
S = s & sz (Val (Mid (zh (1), I, 1) & Choose (I, ""," ")
Next
S = s & "whole"
Return s
End Function

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.