C#保留小数位的方法集合
摘要:
System.Globalization.NumberFormatInfo provider = new System.Globalization.NumberFormatInfo();provider.NumberDecimalDigits =intDecLength; //要设定的小数位数double strCashAmt=Convert.ToDouble(this.txtCashAmt.Text); //先把控件內的值转成doublethis.txtCashAmt.Text = strCashAmt.ToString("N",provider); //再利用ToStr 阅读全文
posted @ 2011-02-23 21:51 任生风影 阅读(698) 评论(0) 推荐(0) 编辑