D DJ6674 Unregistered / Unconfirmed GUEST, unregistred user! 2005-05-26 #1 var a: real; 假设a的值是5.68484859843.我要输出小数点后4位.5.6848. 如何啊?? 是format吗?? 高手赐教啊.
D DJ6674 Unregistered / Unconfirmed GUEST, unregistred user! 2005-05-26 #2 var a: real; 假设a的值是5.68484859843.我要输出小数点后4位.5.6848. 如何啊?? 是format吗?? 高手赐教啊.
X xianguo Unregistered / Unconfirmed GUEST, unregistred user! 2005-05-26 #3 function FormatFloat(const Format: string Value: Extended): string overload; function FormatFloat(const Format: string Value: Extended const FormatSettings: TFormatSettings): string overload;
function FormatFloat(const Format: string Value: Extended): string overload; function FormatFloat(const Format: string Value: Extended const FormatSettings: TFormatSettings): string overload;
X xianguo Unregistered / Unconfirmed GUEST, unregistred user! 2005-05-26 #4 Edit1.Text := FormatFloat('0.0000', 5.68484859843);
X xianguo Unregistered / Unconfirmed GUEST, unregistred user! 2005-05-26 #6 Edit1.Text := FormatFloat('0.0000', 5.68484859843);
X xianguo Unregistered / Unconfirmed GUEST, unregistred user! 2005-05-26 #7 FormatFloat example The following table shows some sample formats and the results produced when the formats are applied to different values: Format string- 1234 -1234 0.5 0 1234 -1234 0.5 0 0 1234 -1234 1 0 0.00 1234.00 -1234.00 0.50 0.00 #.## 1234 -1234 .5 #,##0.00 1,234.00 -1,234.00 0.50 0.00 #,##0.00;(#,##0.00) 1,234.00 (1,234.00) 0.50 0.00 #,##0.00;;Zero 1,234.00 -1,234.00 0.50 Zero 0.000E+00 1.234E+03 -1.234E+03 5.000E-01 0.000E+00 #.###E-0 1.234E3 -1.234E3 5E-1 0E0
FormatFloat example The following table shows some sample formats and the results produced when the formats are applied to different values: Format string- 1234 -1234 0.5 0 1234 -1234 0.5 0 0 1234 -1234 1 0 0.00 1234.00 -1234.00 0.50 0.00 #.## 1234 -1234 .5 #,##0.00 1,234.00 -1,234.00 0.50 0.00 #,##0.00;(#,##0.00) 1,234.00 (1,234.00) 0.50 0.00 #,##0.00;;Zero 1,234.00 -1,234.00 0.50 Zero 0.000E+00 1.234E+03 -1.234E+03 5.000E-01 0.000E+00 #.###E-0 1.234E3 -1.234E3 5E-1 0E0