c# 金额转汉字


     static string[] cs = new [] { "", "", "", "", "", "", "", "", "", "" };
        static string[] unit = new[] { "", "", "", "", "", "", "", "", "", "","亿" };

        public static string ToRMB(this decimal val ) {

         return  string.Join("",  val.ToString("f2").Replace(".", "").ToArray().Reverse().Select((x, i) => $"{cs[Convert.ToInt32(x.ToString())]}{unit[i]}").Reverse());

        }