#和0的區別:
#是對應位有值顯示,無值不顯示
0是對應位有值顯示,無值顯示0
分號后的字符串是對負值的格式化特殊定義:
s := FormatFloat(
'00.0;(0.00)',
1.123
);
//返回:
01.1
s := FormatFloat(
'00.0;(0.00)',
-1.123);
//返回:
(1.12)
其他格式化:
s := FormatFloat('###.###',12.3456);
//返回: 12.346
s := FormatFloat('000.000',12.3456);
//返回: 012.346
s := FormatFloat('#.###',12.3);
//返回: 12.3
s := FormatFloat('0.000',12.3);
//返回: 12.300
s := FormatFloat('#,#.#',1234567);
//返回: 1,234,567
s := FormatFloat('0,0.0',1234567);
//返回: 1,234,567.0
s := FormatFloat('0.00E+0',1234567);
//返回: 1.23E+6
s := FormatFloat('0.00E+00',1234567);
//返回: 1.23E+06