Hi
I have a numeric column on a datagrid that I am putting into a textbox, The problem is that the value has 4 decimal places and I want to show no decimals. I am not sure though how to convert it to a decimal. pPrem_Optimized in the grid has 4 decimals I want it to show in the textbox with none. Here is the line does anyone know how to limit it to no decimals?
prem_OptimizedTextBox.Text = Grid_Property.Rows[e.RowIndex].Cells[
"pPrem_Optimized"].Value.ToString();Thanks
Mansi ShahPosted Dec 1, 2008, 5:34 AM
Label1.Text = "12.534";
Label1.Text = Math.Round(Convert.ToDecimal(Label1.Text),0).ToString();
Bechir BejaouiPosted Nov 30, 2008, 11:09 AM
String.Format( "{0:D}", yourVariable);