Reputation: 127
How can I convert this column into a whole number instead of a decimal?
Upvotes: 0
Views: 677
Reputation: 66509
After setting the DataSource
for your DataGridView
, specify the numeric format of that column:
dataGridView1.Columns["age"].DefaultCellStyle.Format = "N0";
Upvotes: 1
Reputation: 3026
Well, I'm not sure exactly where your code is, but in general you'd say
Convert.ToInt32(age)
Upvotes: 0