0

How can I convert this column into a whole number instead of a decimal?

enter image description here

Grant Winney
  • 65,241
  • 13
  • 115
  • 165
Kevin Rodriguez
  • 117
  • 1
  • 2
  • 10

2 Answers2

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