zoukankan      html  css  js  c++  java
  • 数字转化为大写中文

      private static string[] cstr = { "", "", "", "", "", "", "", "", "", "" };
    private static string[] wstr = { "", "", "", "", "", "", "", "", "", "", "", "" };

    /// <summary>
    /// 数字转化为大写中文
    /// </summary>
    /// <param name="strNumber"></param>
    /// <returns></returns>
    public string ToUpperStr(string strNumber)
    {
    int intLength = strNumber.Length;
    string strTemp = "";
    string strResult = "";

    for (int i = 0; i < intLength;i++ )
    {
    strTemp
    = strNumber.Substring(intLength - i - 1, 1);
    strResult
    = String.Concat(cstr[Int32.Parse(strTemp)] + wstr[i], strResult);
    }

    strResult
    = strResult.Replace("拾零", "");
    strResult
    = strResult.Replace("零拾", "");
    strResult
    = strResult.Replace("零佰", "");
    strResult
    = strResult.Replace("零仟", "");
    strResult
    = strResult.Replace("零萬", "");

    for (int i = 1; i <= 6;i++ )
    {
    strResult
    = strResult.Replace("零零", "");
    }

    strResult
    = strResult.Replace("零萬", "");
    strResult
    = strResult.Replace("零億", "");
    strResult
    = strResult.Replace("零零", "");

    return strResult;
    }
  • 相关阅读:
    centos 6 安装
    DNS介绍
    Saltstack远程执行(四)
    Saltstack数据系统Grains和Pillar(三)
    array_multisort 二维数组排序
    jqgit...
    Redis 创建多个端口 链接redis端口
    百度商桥回话接口
    加ico
    redis 新开端口号
  • 原文地址:https://www.cnblogs.com/xiebin1986/p/1721397.html
Copyright © 2011-2022 走看看