烂 烂泥 Unregistered / Unconfirmed GUEST, unregistred user! 2000-07-12 #2 format('%8.2f',[your data]); 如 format('%8.2f', [query1.Fields [0].asfloat])
K kucio Unregistered / Unconfirmed GUEST, unregistred user! 2000-07-12 #3 format('%8.2f', '123.321');
T tanxh Unregistered / Unconfirmed GUEST, unregistred user! 2000-07-12 #5 function : formatfloat or floatformat
S sh7 Unregistered / Unconfirmed GUEST, unregistred user! 2000-07-12 #7 label1.caption:=formatfloat('%4.2f',12) 为什麽显示结果是:%42f
E e.com Unregistered / Unconfirmed GUEST, unregistred user! 2000-07-12 #8 FloatToStrF(Value,ffNumber,15,2) GO!
烂 烂泥 Unregistered / Unconfirmed GUEST, unregistred user! 2000-07-12 #9 >> label1.caption:=formatfloat('%4.2f',12) 为什麽显示结果是:%42f 是 label1.caption:=format('%4.2f',[12.567])
>> label1.caption:=formatfloat('%4.2f',12) 为什麽显示结果是:%42f 是 label1.caption:=format('%4.2f',[12.567])
S sh7 Unregistered / Unconfirmed GUEST, unregistred user! 2000-07-12 #10 如果是数12,我想显示成12.00! 对不起,我知道我很烦!
D Dick Unregistered / Unconfirmed GUEST, unregistred user! 2000-07-12 #11 FormatFloat('#0.00', XXX)就可以了 前面任意长度都可以保留,后面可以保留两个0
烂 烂泥 Unregistered / Unconfirmed GUEST, unregistred user! 2000-07-12 #12 还是用Formatflaot吧 procedure TForm1.Button1Click(Sender: TObject); var i:real; begin i:=12.612412; label1.Caption :=formatfloat('#.00',i); end;
还是用Formatflaot吧 procedure TForm1.Button1Click(Sender: TObject); var i:real; begin i:=12.612412; label1.Caption :=formatfloat('#.00',i); end;