How can I convert this column into a whole number instead of a decimal?
Asked
Active
Viewed 665 times
0
-
the column type is number – Kevin Rodriguez Mar 26 '15 at 00:49
-
possible duplicate of [How do I convert a decimal to an int in C#?](http://stackoverflow.com/questions/501090/how-do-i-convert-a-decimal-to-an-int-in-c) – Victor2748 Mar 26 '15 at 00:58
2 Answers
1
After setting the DataSource
for your DataGridView
, specify the numeric format of that column:
dataGridView1.Columns["age"].DefaultCellStyle.Format = "N0";

Grant Winney
- 65,241
- 13
- 115
- 165
0
Well, I'm not sure exactly where your code is, but in general you'd say
Convert.ToInt32(age)

CindyH
- 2,986
- 2
- 24
- 38