Double to String?

I have to display a vairable type Double. Is there are DoubleToStr?? Ive tried IntToStr(x) but it didnt work and thats the only one I know :)

Thanks
B.
BRowleyAsked:
Who is Participating?
 
wimmeyvaertConnect With a Mentor Commented:
Works fine with me :

procedure TForm1.Button1Click(Sender: TObject);
var
  dblTemp : Double;
begin
  inherited;
  dblTemp := 67876;
  ShowMessage(FloatToStr(dblTemp));
  ShowMessage(FloatToStrF(dblTemp,ffFixed,10,2));
end;
0
 
wimmeyvaertCommented:
Try FloatToStr-Function

The Mayor
0
 
kretzschmarCommented:
or FloatToStrF
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
BRowleyAuthor Commented:
Sorry no, it displays a totaly different number.

The var = 67876 and when I do the Floattostr it displays 6.83839027164864E -317

not quite what the var is :)
Any others please?
0
 
geobulCommented:
I would prefer Format function:

xStr := Format('%10.2f',[x]);

Regards, Geo
0
 
BRowleyAuthor Commented:
Thanks
regards
B.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.