‘%.2f‘ 与 ‘{:.2f}‘.format(w) 区别

procedure TForm1.btnDistortClick(Sender: TObject); var lcStr: string; lcRad: Single; begin if chkDistort.Checked then begin if (GL_Distort_Average <> 0) and (GL_Distort_Dx <> 0) and (GL_Distort_Ddx <> 0) and (GL_Distort_MaxDst <> 0) then begin if Trim(edt7.Text) = '' then begin m1.Lines.Add('Error: Rad is Empty'); Exit end else lcRad:= StrToFloat(edt7.Text); m1.Clear; Write_ResultFile('*********Distort*********'); Write_ResultFile(FormatDateTime('yyyy.mm.dd hh:nn:ss',Now())); Write_ResultFile('Radius:'); lcStr:= Format('%.2f %.2f %.2f %.2f' + #13#10+ '%.2f %.2f %.2f %.2f' + #13#10+ '%.2f %.2f %.2f %.2f' + #13#10+ '%.2f %.2f %.2f %.2f' + #13#10+ '%.2f %.2f %.2f %.2f' + #13#10+ '%.2f %.2f %.2f %.2f' + #13#10, [GL_RadLong[0], GL_RadLong[1], GL_RadLong[2] ,GL_RadLong[3], GL_RadLong[4], GL_RadLong[5], GL_RadLong[6] ,GL_RadLong[7], GL_RadLong[8], GL_RadLong[9], GL_RadLong[10] ,GL_RadLong[11], GL_RadLong[12], GL_RadLong[13], GL_RadLong[14] ,GL_RadLong[15], GL_RadLong[16], GL_RadLong[17], GL_RadLong[18] ,GL_RadLong[19], GL_RadLong[20], GL_RadLong[21], GL_RadLong[22] ,GL_RadLong[23]]) ; Write_ResultFile(lcStr); lcStr:= Format('Scale Distort:%.2f %%',[Abs(GL_Distort_Dx)*100]); //ccx Write_ResultFile(lcStr); m1.Lines.Add(lcStr); lcStr:= Format('Variance Distort:%.2f %%',[GL_Distort_Ddx*100]); Write_ResultFile(lcStr); m1.Lines.Add(lcStr); lcStr:= Format('Max Distort:%.2f %%',[abs(GL_Distort_MaxDst - lcRad)*100/lcRad]); Write_ResultFile(lcStr); m1.Lines.Add(lcStr); Write_ResultFile('*********Distort*********'+ #13#10); end; end; end;
最新发布
11-11
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值