金额大小写转化类
Posted by adminMay 15
using System; using System.Collections.Generic; using System.Text; using System.Text.RegularExpressions; namespace ConsoleApplication1 { /// /// 类 名: MoneyHelper /// 版 本 号: V1.0 /// 作 者: 张远强 /// HomePage: http://www.mzwu.com/ /// 创建日期: 2009-05-12 /// 功能描述: 金额大小写转化类 /// public sealed class MoneyHelper { /// /// 转为小写金额 /// /// 大写金额 /// public static double ToLower(string money) { return ToLowerForInt(money) + ToLowerForDec(money); } /// /// 转为小写金额(整数) /// /// 大写金额 /// private static double ToLowerForInt(string money) { string[] units = new string[] { "亿", "万", "千", "百", "十", "元" };//金额单位数组 int[] indexs = new int[] { 8, 4, 3, 2, 1, 0 };//金额单位对应位数,如亿位于第8位,百位于第2位,元位于第0位 string[] items = new string[] { "零", "一", "二", "三", "四", "五", "六", "七", "八", "九" };//十个基本数字(大写) double[] results = new double[indexs[0] + indexs[1] + 2];//保存结果,其长度为最大的两个单位位数之和+1 <a href="http://www.lixiaopeng.org/category-into-the-amount-of-sensitive/#more-994" class="more-link">Read the rest of this entry</a>