title: JQuery file upload file size conversion to kb
body: <p>I have this code to get the size of an uploaded file:</p>
  
  <pre><code>var iSize = ($("#formmedia")[0].files[0].size / 1024); 
  if (iSize / 1024 &gt; 1) 
  { 
  if (((iSize / 1024) / 1024) &gt; 1) 
  { 
      iSize = (Math.round(((iSize / 1024) / 1024) * 100) / 100);
      $("#size").html( iSize + "Gb"); 
  }
  else
  { 
      iSize = (Math.round((iSize / 1024) * 100) / 100)
      $("#size").html( iSize + "Mb"); 
  } 
  } 
  else 
  {
  iSize = (Math.round(iSize * 100) / 100)
  $("#size").html( iSize  + "kb"); 
  }
  </code></pre>
  
  <p>This code works completely fine but it shows the output as:</p>
  
  <pre><code>&lt;div id="size"&gt;5.78 Mb&lt;/div&gt;
  </code></pre>
  
  <p>How can I get it to ALWAYS ONLY show Kilobytes?</p>