'%' [[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

Date and time formatting characters

Specifier Description Display
(ex. 2021-01-02 17:03:04)
c Formats date using shortdateformat and formats time using longtimeformat if the time is not zero. 2021-01-02 오후 5:03:04
d day of month 2
dd day of month (leading zero) 02
ddd day of week (abbreviation)
dddd day of week (full) 토요일
ddddd shortdateformat 2021-01-02
dddddd longdateformat 2021년 1월 2일 토요일
m month or minutes if preceded by h or hh specifiers. 1
mm month or minutes if preceded by h or hh specifiers, with leading zero. 01
mmm month (abbreviation) 1
mmmm month (full) 1월
y year (2 digits) 21
yy year (two digits) 21
yyyy year (with century) 2021
h hour 17
hh hour (leading zero) 17
n minute 3
nn minute (leading zero) 03
s second 4
ss second (leading zero) 04
z milliseconds 0
zzz milliseconds(leading zero) 000
am/pm use 12 hour clock and display am and pm accordingly pm
a/p use 12 hour clock and display a and p accordingly p
t shorttimeformat 오후 5:03
tt longtimeformat 오후 5:03:04

 

참고 : https://www.freepascal.org/docs-html/rtl/sysutils/formatchars.html

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

[델파이] Format  (0) 2021.08.27

+ Recent posts