23-08-2012, 12:25 PM
كود :
Example code : Display numbers with Scientific formatting
var
amount1 : Extended;
begin
amount1 := 1234.567;
// Display in a Scientific format
ShowMessage('Using 8,4 = '+FloatToStrF(amount1, ffExponent, 8, 4));
ShowMessage('Using 4,4 = '+FloatToStrF(amount1, ffExponent, 4, 4));
ShowMessage('Using 4,2 = '+FloatToStrF(amount1, ffExponent, 4, 2));
ShowMessage('Using 2,4 = '+FloatToStrF(amount1, ffExponent, 2, 4));
end;// Result
كود :
Using 8,4 = 1.2345670E+0003
Using 4,4 = 1.235E+0003
Using 4,2 = 1.235E+03
Using 2,4 = 1.2E+0003
