title: JavaScript: Round to the nearest value on a scale
body: <p>Lets say I have a scale with 10 values between a know min and max value. How can I get the nearest value on the scale for value between min and max. Example:</p>
  
  <pre><code>min = 0, max = 10, value = 2.75 -&gt; expected: value = 3
  min = 5, max = 6, value = 5.12 -&gt; expected: value = 5.1
  min = 0, max = 1, value = 0.06 -&gt; expected: value = 0.1
  </code></pre>