Added function to round array values to the nearest value in a given list.