From Delphi help about format strings
"%" [index ":"]
["-"] [width] ["." prec]
type
d Decimal. The argument must be
an integer value. The value is converted to a string of decimal digits. If the
format string contains a precision
specifier, it indicates that the resulting string must contain at least the
specified number of digits; if the value has less digits, the resulting string is left-padded with
zeros.
Reads pretty clearly to me. :-)
-----Original Message-----
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf
Of John Bird
Sent: Monday, 27 January 2003 6:32 p.m.
To: Multiple
recipients of list delphi
Subject: RE: [DUG]: Formating
integer
Thanks folks, both of the suggestions below worked. Why
the . is in front
of the 3 mystifies me - my help says its the other way
around, and I never
thought to apply the formatfloat function to an
Integer. So Delphi is
mainly but not all intuitive!
>You need
3 after the decimal point try
>format('%.3d',[TNMBR])
ATNMBR =
FormatFloat("000", TNMBR);
John Bird
Beyond Data
Systems
[EMAIL PROTECTED]
Ph 64-3-3654656 or 027 436-7702
Fax
03-3793340
---------------------------------------------------------------------------
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/
- [DUG]: Dollar amounts in int fields Steven Knight
- Re: [DUG]: Dollar amounts in int fields John Bird
- Re: [DUG]: Dollar amounts in int fields Bevan Edwards
- Re: [DUG]: Dollar amounts in int fields Alex Kouznetsov
- RE: [DUG]: Dollar amounts in int fields Rose, Allan
- RE: [DUG]: Formating integer John Bird
- RE: [DUG]: Formating integer Alan Rose
- RE: [DUG]: Formating integer John Bird
- RE: [DUG]: Dollar amounts in int fields Steven Knight
- RE: [DUG]: Dollar amounts in int fields Rose, Allan
