if (cn.State != ConnectionState.Open) cn.Open(); cmd = new SqlCommand("SP_Exchange_Rate_Update", cn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@SHORT_NAME", Txt_Currency.Text); cmd.Parameters.AddWithValue("@CURRENCY", Txt_Desc.Text); cmd.Parameters.AddWithValue("@EXCHANGE_RATE",Convert.ToDouble(Txt_Rate.Text)); cmd.ExecuteNonQuery(); cn.Close(); loaddata(); LoadCurrency(); Txt_Currency.ReadOnly = true;
string str = "1.225222222"; decimal value = 0; decimal.TryParse(str, out value); value = Math.Round(value, 2);
string str = "1.225222222"; string value= Math.Round(Convert.ToDouble(str), 2).ToString();
string str = "3.14159"; float fnum = float.Parse(str);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)