title: round off float to nearest 0.5 in python
body: <p>I'm trying to round off floating digits to the nearest 0.5</p>
  
  <p>For eg.</p>
  
  <pre><code>1.3 -&gt; 1.5
  2.6 -&gt; 2.5
  3.0 -&gt; 3.0
  4.1 -&gt; 4.0
  </code></pre>
  
  <p>This is what I'm doing</p>
  
  <pre><code>def round_of_rating(number):
          return round((number * 2) / 2)
  </code></pre>
  
  <p>This rounds of numbers to closest integer. What would be the correct way to do this?</p>