Fastest Way to Round to the Nearest 5/100ths
<p>I have numbers that I want to go from:</p>

<pre><code>1.215145156155 =&gt; 1.2
1.368161685161 =&gt; 1.35
1.578414616868 =&gt; 1.6
</code></pre>

<p>(*Note: the hundredths place should not be marked if it is zero.)</p>

<p>What's the <strong><em>fastest</em></strong> way to do this?</p>

<p>This is what I have right now, and it is not fast enough:</p>

<pre><code>def rounder(v):
    v = str(round(float(v),2))
    if len(v) == 3: v = v + str(0)
    d0 = int(v[0])#ones
    d1 = int(v[2])#tenths
    d2 = int(v[3])#hundredths
    if d2 &lt;= 4:
        return str(d0)+'.'+str(d1)
    elif 4 &lt; d2 &lt; 7:
        return str(d0)+'.'+str(d1)+str(5)
    elif d2 &gt;= 7:
        if d1 != 9:
            return str(d0)+'.'+str(d1+1)
        if d1 == 9:
            return str(d0+1)+'.'+str(0)
</code></pre>
