随笔分类 -  丶常用数字处理技术

丶格式化输入数据为货币格式
摘要:效果图:代码: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;using System.Globalization;namespace Example51{ public partial class Form1 : Form { public Form1() { Ini... 阅读全文
posted @ 2011-10-23 17:33 C#_初学者 阅读(348) 评论(0) 推荐(0)
丶对计算结果进行四舍五入
摘要:效果图:原理:在所有要丢失精度的小数位中加5,大于10进位代码: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 Example48{ public partial class Form1 : Form { public Form1() { Initi... 阅读全文
posted @ 2011-10-23 13:37 C#_初学者 阅读(277) 评论(0) 推荐(0)
丶判断输入的货币值是否为数字
摘要:TryParse方法首先会尝试将字符串转换为指定数值类型,如果转换成功 则 返回 True 并对参数中变量赋值。 否则 返回False 语法如下:double.TryParse(string str, out double result);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;name 阅读全文
posted @ 2011-10-23 13:15 C#_初学者 阅读(247) 评论(0) 推荐(0)