Hi Greetings for the Day
i hav one data table in which some decimal values are up 6 decimal places.. im trying to bind that Data table to DataGridView while binding i want to round decimal values up to two decimal palces here is my code
dt.Columns.Add("Orderid", typeof(string));
dt.Columns.Add("tagnumber", typeof(string));
dt.Columns.Add("Minimum Value", typeof(string));
dt.Columns.Add("Maximum Value", typeof(string));
int count = ds.Tables[0].Rows.Count;
for (int i = 0; i < count; i++)
{
DataRow dr = null;
dr = dt.NewRow();
dr["tagnumber"] = ds.Tables[0].Rows[i]["min"].ToString();
dr["quantity"] = ds.Tables[0].Rows[i]["max"].ToString();
dr["issuedby"] = ds.Tables[0].Rows[i]["sum"].ToString();
dt.Rows.Add(dr);
}
gvdemo.DataSource = dt.DefaultView;
howshould i round up while binding..?
Thanks In Advance