Dzwebs.Net

撰写电脑技术杂文十余年

asp.net将人民币数字转为为对应的大写金额代码下篇

Admin | 2010-1-21 20:41:05 | 被阅次数 | 6837

温馨提示!

如果未能解决您的问题,请点击搜索;登陆可复制文章,点击登陆

  接中篇…

        else
        {
            //该位是万亿,亿,万,元位等关键位
            if (str3 != "0" && nzero != 0)
            {
                ch1 = "零" + str1.Substring(temp * 1, 1);
                ch2 = str2.Substring(i, 1);
                nzero = 0;
            }
            else
            {
                if (str3 != "0" && nzero == 0)
                {
                    ch1 = str1.Substring(temp * 1, 1);
                    ch2 = str2.Substring(i, 1);
                    nzero = 0;
                }
                else
                {
                    if (str3 == "0" && nzero >= 3)
                    {
                        ch1 = "";
                        ch2 = "";
                        nzero = nzero + 1;
                    }
                    else
                    {
                        if (j >= 11)
                        {
                            ch1 = "";
                            nzero = nzero + 1;
                        }
                        else
                        {
                            ch1 = "";
                            ch2 = str2.Substring(i, 1);
                            nzero = nzero + 1;
                        }
                    }
                }
            }
        }
        if (i == (j - 11) || i == (j - 3))
        {
            //如果该位是亿位或元位,则必须写上
            ch2 = str2.Substring(i, 1);
        }
        str5 = str5 + ch1 + ch2;
        if (i == j - 1 && str3 == "0")
        {
            //最后一位(分)为0时,加上“整”
            str5 = str5 + '整';
        }
    }
    if (num == 0)
    {
        str5 = "零元整";
    }
    return str5;
}


该杂文来自: 网站开发杂文

上一篇:asp.net将人民币数字转为为对应的大写金额代码中

下一篇:asp.net读取SQL数据库显示二进制图片的代码

网站备案号:

网站备案号:滇ICP备11001339号-7

版权属性:

Copyright 2007-2021-forever Inc. all Rights Reserved.

联系方式:

Email:dzwebs@126.com QQ:83539231 访问统计