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
浙公网安备 33010602011771号