'%' [[Index]':'] ['-'] [Width] ['.' Precision] ArgType
'%' starts the placeholder.
If you want to insert a literal 
% character, then you must insert two of them : %%.
Index ':' takes the Index-th element in the argument array as the element to insert.
If 
index is omitted, then the zeroth argument is taken.
'-'
tells Format to left-align the inserted text.
The default behaviour is to right-align inserted text.
This can only take effect if the 
Width element is also specified.
Width
the inserted string must have at least Width characters.
If not, the inserted string will be padded with spaces. By default, the string is left-padded, resulting in a right-aligned string.
This behaviour can be changed by the usage of the 
'-' character.
'.' Precision
Indicates the precision to be used when converting the argument.
The exact meaning of this parameter depends on 
ArgType.

 

- ArgType

D Decimal format.  format('%d', [-123]) -123
E Scientific format.  format('%e', [12345.678]) 1.23456780000000E+004
F Fixed point format. format('%f', [12345.678]) 12345.68
G General number format. format('%g', [12345.678]) 12345.678
M Currency format.  format('%n', [12345.678]) 12,345.68
N Number format. format('%m', [12345.678]) ₩12,346
P Pointer format. format('%p', [addr(text)]) 0019F35C
S String format. format('%s', ['Hello']) Hello
U Unsigned decimal format. format('%u', [123]) 123
X hexadecimal format.  format('%x', [140]) 8C

 

- 참고

https://www.freepascal.org/docs-html/rtl/sysutils/format.html

http://www.delphibasics.co.uk/RTL.asp?Name=format

 

'개발 > 델파이(라자루스)' 카테고리의 다른 글

[델파이]날짜/시간 출력  (0) 2021.08.26

+ Recent posts