C#实现将商品金额小写转换成大写

/// <summary>
        /// 将商品金额小写转换成大写
        /// </summary>
        /// <param name="par">小写金额</param>
        /// <returns>处理后的大写金额</returns>
        public static string MoneySmallToBig(string par)
        {
            String[] Scale = { "", "", "", "", "", "", "", "", "", "", "亿", "", "", "", "", "", "", "" };
            String[] Base = { "", "", "", "", "", "", "", "", "", "" };
            string Temp = par;
            object str = Temp[1];
            string result = null;
            int index = Temp.IndexOf(".", 0, Temp.Length);//判断是否有小数点
            if (index != -1)
            {
                Temp = Temp.Remove(Temp.IndexOf("."), 1);
                for (int i = Temp.Length; i > 0; i--)
                {
                    int Data = Convert.ToInt16(Temp[Temp.Length - i]);//得到对应的ASCII码值
                    result += Base[Data - 48];
                    result += Scale[i - 1];
                }
            }
            else
            {
                for (int i = Temp.Length; i > 0; i--)
                {
                    int Data = Convert.ToInt16(Temp[Temp.Length - i]);
                    result += Base[Data - 48];
                    Console.WriteLine(result);
                    result += Scale[i + 1];
                    Console.WriteLine(result);
                }
            }
            //Console.WriteLine(Base[43]);
            return result;
        }
原文地址:https://www.cnblogs.com/sdd53home/p/13572538.html