how about a two step process
function pad(value:string);
begin
if length(value=1 then
begin
result := '0' + value;
end
else
begin
result = value;
end;
end;
pad(inttostr(value));
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of Leigh Wanstead
> Sent: Monday, 28 July 2003 10:49 a.m.
> To: Multiple recipients of list delphi
> Subject: [DUG]: Integer conversion
>
>
> Hello everyone,
>
> I want to convert integer to string.
>
> Here is the rule
>
> Integer String
> 1 '01'
> 2 '02'
> 3 '03'
> 4 '04'
> 5 '05'
> 6 '06'
> 11 '11'
> 12 '12'
>
> It convert int to string, if width less than 1, put '0' in
> front of String.
>
> I checked help file about format and can not find the right
> one I want.
>
> TIA
>
> Regards
> Leigh
>
> --------------------------------------------------------------
> -------------
> New Zealand Delphi Users group - Delphi List -
> [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
> Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.504 / Virus Database: 302 - Release Date: 24/07/03
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.504 / Virus Database: 302 - Release Date: 24/07/03
______________________________________________________
The contents of this e-mail are privileged and/or confidential to the
named recipient and are not to be used by any other person and/or
organisation. If you have received this e-mail in error, please notify
the sender and delete all material pertaining to this e-mail.
______________________________________________________
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/