日期:2014-05-18 浏览次数:21046 次
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication2 { public partial class Form1 : Form { string Zz = "零壹贰叁肆伍陆柒捌玖", Bj = "0123456789"; Double SsWr = new double(); bool PanDuan = true; string[] Jz = { "元", "拾", "佰", "仟" }; string[] Jzs = { "拾", "佰", "仟" }; string[] Zs = { "万", "亿", "兆", "京", "垓", "秭", "穰", "沟", "涧", "正", "载", "极", "恒河沙", "阿僧祇", "那由他", "不可思议", "☆无量", "☆不可说☆" }; string[] Xs = { "角", "分", "厘","毫","丝","忽","微","纤","沙","尘","埃","渺","莫", "模糊", "逡巡","须臾","瞬息","弹指","刹那","六德","空虚","☆清静" }; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { ToolTip KjTs = new ToolTip(); KjTs.SetToolTip(ZhuanHuang, "单击执行转换"); KjTs.SetToolTip(XuanXiang, "请选择要执行小数的“四舍五入”位数"); KjTs.SetToolTip(Kuo, "选择该项时将强行扩展整数的位数到万无量=[不可说],没有实际意义。"); } private void ZhuanHuang_Click(object sender, EventArgs e) { string DD_BM = SuZi.Text.Trim(); string[] Fg = new string[2]; try { if (SuZi.Text.Length > 99 || SuZi.Text == "") { if (SuZi.Text.Length > 99) MessageBox.Show("1、操作非法,输入数值超过范围,无法计算!请重新输入小等于69位整数(强制扩展:小等于76位)和小等于22位小数!", "友情提示!", MessageBoxButtons.OK, MessageBoxIcon.Information); if (SuZi.Text == "") MessageBox.Show("2、操作非法!请重新输入小等于69位整数(强制扩展:小等于76位)和小等于22位小数!", "友情提示!", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { string GuoLvZiFu = DD_BM; ZongWenSuZhi.Text = ""; SsWr = 0; do { GuoLvZiFu = 过滤(GuoLvZiFu, false); } while (PanDuan == false);//再循环 DD_BM = GuoLvZiFu; if (ZzS.Checked) { do { GuoLvZiFu = 过滤(GuoLvZiFu, true); } while (PanDuan == false);//再循环 DD_BM = GuoLvZiFu; if (DD_BM.IndexOf("元") >= 0) { Fg = DD_BM.Split('元'); } //整数 else { Fg[0] = ""; Fg[1] = DD_BM; }//纯小数 } if (SzZ.Checked) Fg = DD_BM.Split('.'); if (ZzS.Checked)//中文→数字 { if (Fg[0] != "") //整数部分 { if (Zhuan.Checked) ZongWenSuZhi.Text = Zh_Zwz(ZzZhengShu(Fg[0]), "中文→数字整数", true); if (!Zhuan.Che