I igghdeee Unregistered / Unconfirmed GUEST, unregistred user! 2006-06-05 #1 怎么样把变量以3位小数输出,即0.000的形式,不然太长! 还有rightstr是怎么用的啊,我的不行,比如说rightstr(sldkfjsdfjs,3)
K kaida Unregistered / Unconfirmed GUEST, unregistred user! 2006-06-05 #2 str:=format('.3f',[sldkfjsdfjs]);
H hityou Unregistered / Unconfirmed GUEST, unregistred user! 2006-06-05 #3 formatfloat('.000',1.1111)
A anndy1999 Unregistered / Unconfirmed GUEST, unregistred user! 2006-06-05 #4 var tt:string; begin tt:=Format('%.3f',[12.00000]); end;
晚 晚起的小虫 Unregistered / Unconfirmed GUEST, unregistred user! 2006-06-05 #5 str:=format('.3f',[sldkfjsdfjs]); s := rightstr(format('.3f',[sldkfjsdfjs]),3) ;//结果为sldkfjsdfjs的三个小数 rightstr是指取字符串的指定个数的字符,从右开始取。 function RightStr(const AText: AnsiString; const ACount: Integer): AnsiString; overload; function RightStr(const AText: WideString; const ACount: Integer): WideString; overload;
str:=format('.3f',[sldkfjsdfjs]); s := rightstr(format('.3f',[sldkfjsdfjs]),3) ;//结果为sldkfjsdfjs的三个小数 rightstr是指取字符串的指定个数的字符,从右开始取。 function RightStr(const AText: AnsiString; const ACount: Integer): AnsiString; overload; function RightStr(const AText: WideString; const ACount: Integer): WideString; overload;
N newsmile Unregistered / Unconfirmed GUEST, unregistred user! 2006-06-07 #7 rightstr('sldkfjsdfjs',3)
W wangmao Unregistered / Unconfirmed GUEST, unregistred user! 2006-06-07 #8 var s:string; begin s:=formatfloat('0.000',3.99954); end;