Home > Back-end >  How urgent the Delphi the character converted to double type??
How urgent the Delphi the character converted to double type??

Time:09-20

To obtain the field values from a DBF 1.48539705505907 e-315
How to convert type double figures

CodePudding user response:

 var 
F: Double;

F:=StrToFloat (' 1.48539705505907 e-315 ');

CodePudding user response:

Strtofloat may not line

CodePudding user response:

 procedure TForm1. Button1Click (Sender: TObject); 
Var f: Double;
The begin
F:=StrToFloat (' 1.48539705505907 e-315 ');
Edit1. Text:=FloatToStr (F);
Edit2. Text:=FloatToStr (F * 2);
end;


The number within the effective range, feasible, through the Edit, can test,

CodePudding user response:

Didn't give you clear, the original data is 1566885.07 so the above said use strtofloat is no good

CodePudding user response:

If transfer from the string type, StrtoFloat first, and then assigned to a double type variables, data set component bring conversion function, AsFloat directly into a double precision,

CodePudding user response:

Even on the database, and then
Adoquery. Fieldbyname (field name). Asfloat;
  • Related