Ensure number in specified range