//控制幣別小數
System.Globalization.NumberFormatInfo provider = new System.Globalization.NumberFormatInfo();
provider.NumberDecimalDigits =intDecLength; //要設定的小數位數
double strCashAmt=Convert.ToDouble(this.txtCashAmt.Text); //先把控件內的值轉成double
this.txtCashAmt.Text = strCashAmt.ToString("N",provider); //再利用ToString函數格式化小數位數