 <p>Using the newer version <code>''.format</code> (also remember to specify how many digit after the <code>.</code> you wish to display, this depends on how small is the floating number). See this example:</p> <pre><code>&gt;&gt;&gt; a = -7.1855143557448603e-17 &gt;&gt;&gt; '{:f}'.format(a) '-0.000000' </code></pre> <p>as shown above, default is 6 digits! This is not helpful for our case example, so instead we could use something like this:</p> <pre><code>&gt;&gt;&gt; '{:.20f}'.format(a) '-0.00000000000000007186' </code></pre>