How to convert to Bytes Simply
<p>With the file size given to me in MegaBytes (MB) I go ahead and convert it to Bytes:</p>

<pre><code>in_MB = 999.991
in_KB = in_MB * 1024**2
</code></pre>

<p>The resulted value is: 1048566562.82</p>

<p>To verify my calculation is correct I navigate to <a href="https://www.google.com/?ion=1&amp;espv=2#q=1048566562.82%20Bytes%20to%20MB" rel="nofollow">Google Digital Storage Converter</a>: 
and convert the calculated value in Bytes back to MegaBytes expecting to get the same input value I had: 999.991 MB. But surpassingly Google returns another value: 1048.56656282 MB instead of 999.991 MB.</p>

<p>Is there a mistake in my calculations?</p>

<p><a href="http://i.stack.imgur.com/LczPK.png" rel="nofollow"><img src="http://i.stack.imgur.com/LczPK.png" alt="enter image description here"></a></p>

<p>You didn't make a mistake.  Historically, memory and disk sizes were calculated using binary (base 2) numbers (2 ^ 20 or 1,048,576 bytes in a megabyte). Google is using the more recent decimal (base 10) representation of a megabyte (10 ^ 6 or 1,000,000) bytes.</p>

<pre><code>&gt;&gt;&gt; megabyte_size = 999.991
&gt;&gt;&gt; bytes_size = megabyte_size * 2 ** 20
&gt;&gt;&gt; bytes_size / 10 ** 6
1048.566562816
&gt;&gt;&gt; bytes_size / 2 ** 20
999.991
</code></pre>

<p>Further reading:</p>

<p><a href="https://en.wikipedia.org/wiki/Binary_prefix" rel="nofollow">https://en.wikipedia.org/wiki/Binary_prefix</a></p>

python