关于delphi:Delphi-Format-格式化数字
Format('x=%d', [12]); //'x=12' //最一般Format('x=%3d', [12]); //'x= 12' //指定宽度Format('x=%f', [12.0]); //'x=12.00' //浮点数Format('x=%.3f', [12.0]); //'x=12.000' //指定小数Format('x=%.*f', [5, 12.0]); //'x=12.00000' //动静配置Format('x=%.5d', [12]); //'x=00012' //后面补充0Format('x=%.5x', [12]); //'x=0000C' //十六进制Format('x=%1:d%0:d', [12, 13]); //'x=1312' //应用索引Format('x=%p', [nil]); //'x=00000000' //指针Format('x=%1.1e', [12.0]); //'x=1.2E+001' //迷信记数法Format('x=%%', []); //'x=%' //失去"%"S := Format('%s%d', [S, I]); //S := S + StrToInt(I); //连贯字符串\ function Format(const Format: string; const Args: array of const): string; Format字符串阐明: "%" [index ":"] ["-"] [width] ["." prec] type (1) 格式化字符串必须以%结尾 (2) [index ":"] 索引指的是Args参数列表中要显示的每一项的序号。比方:Args是 ...