title: Rounding numbers to a specific resolution
body: <p>I know many languages have the ability to round to a certain number of decimal places, such as with the Python:</p>
  
  <pre><code>&gt;&gt;&gt; print round (123.123, 1)
      123.1
  &gt;&gt;&gt; print round (123.123, -1)
      120.0
  </code></pre>
  
  <p>But how do we round to an arbitrary resolution that is <em>not</em> a decimal multiple. For example, if I wanted to round a number to the nearest half or third so that:</p>
  
  <pre><code>123.123 rounded to nearest half is 123.0.
  456.456 rounded to nearest half is 456.5.
  789.789 rounded to nearest half is 790.0.
  
  123.123 rounded to nearest third is 123.0.
  456.456 rounded to nearest third is 456.333333333.
  789.789 rounded to nearest third is 789.666666667.
  </code></pre>