Whatever was the closest value to the slider value, snap the grid to it and set it as the slider value.