title: Rounding a value to only a list of certain values in C#
body: <p>I have a list of double values, I want to Round a variable's value to only that list of numbers</p>
  
  <p>Example:</p>
  
  <p>The list contents are: {12,15,23,94,35,48}</p>
  
  <p>The Variable's value is 17, So it will be rounded to 15</p>
  
  <p>If The variable's value is less than the least number, it will be rounded to it, if it's value is larger than the largest number, it will be rounded to it.</p>
  
  <p>The list contents is always changing according to an external factor, So I cannot hardocde the values I Want to round up or down to.</p>
  
  <p>How can do it in C# ?</p>