title: content-length conversion
body: <p>I'm checking file-size using a script that report content-length in BYTES that matches exactly what I see on my Mac, BUT if I convert bytes to KBs:</p>
  
  <pre><code>function formatBytes($bytes, $precision = 2) { 
      $units = array('B', 'KB', 'MB', 'GB', 'TB'); 
  
      $bytes = max($bytes, 0); 
      $pow = floor(($bytes ? log($bytes) : 0) / log(1024)); 
      $pow = min($pow, count($units) - 1); 
  
      $bytes /= (1 &lt;&lt; (10 * $pow)); 
  
      return round($bytes, $precision) . ' ' . $units[$pow]; 
  }
  </code></pre>
  
  <p>... the size in KB is always different than what I see on my Mac.</p>
  
  <p>So example:</p>
  
  <p><strong>Windows 8 TV Ad Tune.m4r</strong> </p>
  
  <ul>
  <li>Bytes (Mac): 4,27,840 bytes</li>
  <li><p>KBs (Mac) : 428KB</p></li>
  <li><p>Bytes (Script): 427840</p></li>
  <li>KBs (Script): 417.81 KB</li>
  </ul>
  
  <p>I wonder if its the script or something else causing this difference?</p>
  
  <p>Thanks!</p>