DelphiBasics
IntToStr
Function
Convert an integer into a string SysUtils unit
1 function IntToStr(Number Integer):string;
2 function IntToStr (BigNumber Int64:string;
Description
The IntToStr function converts an Integer Number or Int64 BigNumber into a string.
 
It has two forms : the latter supporting very large integers.
 
It is normally used for display purposes.
Related commands
FloatToStrConvert a floating point value to a string
FormatRich formatting of numbers and text into a string
StrToIntConvert an integer string into an Integer value
 Download this web site as a Windows program.




 
Example code : Converting integers to strings
var
  NormalInteger : Integer;
  BigInteger    : Int64;

begin
  NormalInteger := 2147483647;          // Largest possible Integer value
  BigInteger    := 9223372036854775807;// Largest possible Int64 value

  ShowMessage('NormalInteger :     '+IntToStr(NormalInteger));
  ShowMessage('BigInteger :        '+IntToStr(BigInteger));
  ShowMessage('Calculated number : '+IntToStr(27 * 4));
end;
Show full unit code
  NormalInteger : 2147483647
  BigInteger : 9223372036854775807
  Calculated number : 108
 
Delphi Programming © Neil Moffatt . All rights reserved.  |  Home Page