title: How to get file size properly and convert it to MB, GB in Cocoa?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/572614/objc-cocoa-class-for-converting-size-to-human-readable-string">ObjC/Cocoa class for converting size to human-readable string?</a>  </p>
  </blockquote>
  
  
  
  <p>I'm new in Cocoa. I'm trying to get size of folder files properly. And display it in MB if it less 1 GB , or in GB. </p>
  
  <p>The way I want it to display is rounded with one number after point.</p>
  
  <p>Example 
  <strong>5.5 MB</strong>  if it is more than 1000 > <strong>1.1 GB</strong></p>
  
  <p>I'm trying to use this </p>
  
  <pre><code> unsigned  long long size= ([[[NSFileManager defaultManager] attributesOfItemAtPath:fullPath error:nil] fileSize]);
  </code></pre>
  
  <p>But I can't a way properly convert number, and display it , as I want.</p>
  
  <p>Thanks.</p>