S sw Unregistered / Unconfirmed GUEST, unregistred user! 2001-05-24 #3 对了,若要控制小数的精度,可以这样: double a1 = 11.16789; AnsiString a2 = FormatFloat("0.00",a1); 结果为:11.17
I iie Unregistered / Unconfirmed GUEST, unregistred user! 2001-05-24 #4 上面老兄看来是学CB的,pascal的形式应该是 function FloatToStrF(Value: Extended Format: TFloatFormat Precision, Digits: Integer): string; 如aint := FloatToStr(afloat, ffFixed, 8, 3);
上面老兄看来是学CB的,pascal的形式应该是 function FloatToStrF(Value: Extended Format: TFloatFormat Precision, Digits: Integer): string; 如aint := FloatToStr(afloat, ffFixed, 8, 3);
L lostlastlove Unregistered / Unconfirmed GUEST, unregistred user! 2001-05-24 #5 var ff:double; ss:string; begin ff:=12345.334556; ss:=formatfloat(',##0.00',ff); end; ss值为:12,345.33