摘要: 總結一下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=%8.2f'[12.0])//'x=12.00';
Format('x=%.*f',[5,12.0]);//'x=12.00000'//動態配置
Format('x=%.5d',[12]);//'x=00012'//前面補充0
Format('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
閱讀全文