floating point convertion

asi
asi used Ask the Experts™
on
hello,

How can i convert i have number stored in var type
for example '123423234.456456656'

How can i convert it to float type variable ? ( but when i use the funtion strToFloat some difgits are cutted )

thank you
Asi
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
FormatFloat()
Hi,

Use a variable of Extended type not Double. Double has 15-16 digits while Extended has 19-20.

procedure TForm1.Button1Click(Sender: TObject);
var r: extended;
begin
  r := StrToFloat('123423234.456456656');
  ShowMessage(Format('%10.10f',[r]));
end;

Regards, Geo

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial