string formatting

How can I use specify width and decimal parameter in Str(X [: Width [: Decimals ]]; var S) procedure ?

How can I format a integer (e.g. 123, 1234) to string 00000123 and 00001234 ?

Andrew
andrewyuAsked:
Who is Participating?
 
ZifNabConnect With a Mentor Commented:
Hi,

eg : Format('%.10d', [124])

showmessage(Format('%.10d', [124]));


Zif.
0
 
edeyCommented:
you should see the format function


GL
Mike
0
 
edeyCommented:
oh, and "format strings" in the delphi help would be a good thing to check out too

GL
Mike
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
andrewyuAuthor Commented:
Thank you very much !

Andrew
0
 
ZifNabCommented:
andrewyu,

can you accept a comment (which you find did helped you first/most) as an answer? So this question is moved to the solved question.

TIA,

Zif.
0
 
andrewyuAuthor Commented:
Thank you very much !

Andrew
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.