var s: string;begin Str(123, s); ShowMessage(s); {123} Str(PI, s); ShowMessage(s); {3.14159265358979E+0000} Str(PI:0:2, s); ShowMessage(s); {3.14} Str(9.1:1:3, s); ShowMessage(s); {9.100} Str(100:5, s); ShowMessage('^' + s); {^ 100}end;
本文共 303 字,大约阅读时间需要 1 分钟。
var s: string;begin Str(123, s); ShowMessage(s); {123} Str(PI, s); ShowMessage(s); {3.14159265358979E+0000} Str(PI:0:2, s); ShowMessage(s); {3.14} Str(9.1:1:3, s); ShowMessage(s); {9.100} Str(100:5, s); ShowMessage('^' + s); {^ 100}end;
转载于:https://my.oschina.net/hermer/blog/320173