I am using a Datagidview control on winforms. This is getting filled dynamically. I am trying to display 4 decimal format number in the grid. I applied the DefaultCellStyle property as;
dataGridViewCellStyle2.Format = "N4";
dataGridView1.DefaultCellStyle= dataGridViewCellStyle2;
When I enter data as 21.2134 it displays it properly. But when I enter a complete number like 20, it shows me number as 20.0000. I want to get rid of those trailing 0's.
Edit:
One more issue just encountered. with this code it accepts data as 21.2100.
Please help me to resolve this issue.
Thanks in advance.
Vijay