Use floor, not (int) for rounding