I understand that when finding the mean for grouped data,

with class interval, e.g. $\displaystyle 0 \le x < 5$, we use the midpoint of the interval, then multiply by frequency, and so on...

My question is this,

If x is discrete, for the range $\displaystyle 0\le x < 5$, then x takes values 0, 1, 2, 3, 4. Should we choose 2 for the midpoint? or 2.5?

Which one better?

Thanks!!!