A simple solution to force casting to snap the value is to use a half-unit offset:
iX = (int)(fX + 0.5f);
or to support both positive and negative values:
iX = fX > 0 ? (int)(fX + 0.5f) : (int)(fX - 0.5f);
Note: casting to int truncates towards zero.
Edit: I was too rash - better solutions have been posted above since you're not dealing with unit intervals.