Backup/Form1.cs

(开头部分) 7KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
//获得更有效最新的源码请下载看这里:http://www.51aspx.com
namespace DemoticCurrency
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        //获得更有效最新的源码请下载看这里:http://www.51aspx.com
        ///   <summary>   
        ///   获得decimal类型数字的中文大写形势   
        ///   </summary>   
        ///   <param   name="D_Mstr_theMoney">decimal类型数字存储小写金钱</param>   
        ///   <returns>返回string类型的数字的中文大写形势</returns>
        public string UpMoney(decimal D_Mstr_theMoney)
        {
            string G_str_Money = "零壹贰叁肆伍陆柒捌玖"; //0-9所对应的汉字     
            string G_str_MoneyString = "万仟佰拾亿仟佰拾万仟佰拾元角分";   //数字位所对应的汉字     
            string G_str_Timoney = "";   //从原D_Mstr_theMoney值中取出的值     
            string G_str_NumberString = "";  //数字的字符串形式     
            string G_str_UpMoney = ""; //人民币大写金额形式     
            int i;         //循环变量     
            int j;         //D_Mstr_theMoney的值乘以100的字符串长度     
            string G_ch_Chine = "";  //数字的汉语读法     
            string G_ch_Chineses = ""; //数字位的汉字读法     
            int G_int_ZeroCount = 0;//用来计算连续的零值是几个     
            int G_int_G_int_temp; //从原D_Mstr_theMoney值中取出的值     
            D_Mstr_theMoney = Math.Round(Math.Abs(D_Mstr_theMoney), 2);//将D_Mstr_theMoney取绝对值并四舍五入取2位小数     
            G_str_NumberString = ((long)(D_Mstr_theMoney * 100)).ToString(); //将D_Mstr_theMoney乘100并转换成字符串形式     
            j = G_str_NumberString.Length;//找出最高位     
            if (j > 15) { return "溢出"; }
            G_str_MoneyString = G_str_MoneyString.Substring(15 - j); //取出对应位数的G_str_MoneyString的值。如:200.55,j为5所以G_str_MoneyString=佰拾元角分     
            //循环取出每一位需要转换的值     
            for (i = 0; i < j; i++)
            {
                G_str_Timoney = G_str_NumberString.Substring(i, 1); //取出需转换的某一位的值     
                G_int_G_int_temp = Convert.ToInt32(G_str_Timoney); //转换为数字     
                if (i != (j - 3) && i != (j - 7) && i != (j - 11) && i != (j - 15))
                {
                    //当所取位数不为元、万、亿、万亿上的数字时     
                    if (G_str_Timoney == "0")
                    {
                        G_ch_Chine = "";
                        G_ch_Chineses = "";
                        G_int_ZeroCount = G_int_ZeroCount + 1;
                    }
                    else
                    {
                        if (G_str_Timoney != "0" && G_int_ZeroCount != 0)
                        {
                            G_ch_Chine = "零" + G_str_Money.Substring(G_int_G_int_temp * 1, 1);
后面还有 98 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。