title: Is It Possible To Convert a Comp Type to Int64 or Display a Comp value As a String With Commas
body: <p>I have an event in a component (VCLZip) that uses the comp type, but to display the result as a string I think I need to convert the comp value to int64, but I can not find a way to do so.  <strong>Is there a way to convert a comp value to int64? or is there a different way to display a comp value as a string with commas ... maybe Format?</strong></p>
  
  <pre><code>function FormatKBSize( Bytes: Cardinal ): string;
  { Converts a numeric value into a string that represents the number expressed as a size value in kilobytes. }
  var
  arrSize: array [ 0 .. 255 ] of char;
  begin
     { explorer style }
     Result := '';
     { same formating used in the Size column of Explorer in detailed mode }
     Result := ShLwApi.StrFormatKBSizeW( Bytes, arrSize, Length( arrSize ) - 1 );
   end;
  
  procedure TFormMain.VCLZip1StartZipInfo( Sender: TObject; NumFiles: Integer; TotalBytes: Comp;
    var EndCentralRecord: TEndCentral; var StopNow: Boolean );
  var
    Tb: int64;
  begin
    InfoWin.Lines.Add( '' );
    InfoWin.Lines.Add( 'Number of files to be zipped: ' + IntToStr( NumFiles ) + '...' );
    Tb := TotalBytes; // &lt;= this will not compile
    Tb := Int64(TotalBytes); // &lt;= this will not compile
    InfoWin.Lines.Add( 'Total bytes to process: ' + FormatKBSize( Tb ) + '...' );
   end;
  </code></pre>
  
  <p><strong>Edit - this seems to work but is there a better way?</strong></p>
  
  <pre><code>InfoWin.Lines.Add( Format( '%n', [  TotalBytes ] ) );
  </code></pre>