I have to display the values in DataTable with Exactly Two Decimal places. I want to display like this to looks like a time format. (I apologize for my English) thank you.
protected void Page_Load(object sender, EventArgs e)
{
try
{
DataTable dt = new DataTable();
dt.Columns.Add("SOT", typeof(Decimal));
dt.Columns.Add("SVT", typeof(Decimal));
dt.Columns.Add("SCT", typeof(Decimal));
dt.Rows.Add(12.22,23.44,22.00);
dt.Rows.Add(2.20, 23.00, 22.23);
dt.Rows.Add(12.00, 23.20, 22.05);
GridView1.DataSource = dt;
GridView1.DataBind();
}
catch (Exception d)
{
Response.Write(d.Message.ToString());
}
}
DataTable Can take values like (2.2,23,22.5) not (2.20,23.00,22.5). Is there any method to insert values in DataTable like (2.20,23.00,22.5)