Solved

Double to String?

Posted on 2001-08-22
6
6,209 Views
Last Modified: 2007-12-19
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.
0
Comment
Question by:BRowley
6 Comments
 
LVL 6

Expert Comment

by:wimmeyvaert
ID: 6412897
Try FloatToStr-Function

The Mayor
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6412902
or FloatToStrF
0
 

Author Comment

by:BRowley
ID: 6412916
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 17

Expert Comment

by:geobul
ID: 6412928
I would prefer Format function:

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

Regards, Geo
0
 
LVL 6

Accepted Solution

by:
wimmeyvaert earned 25 total points
ID: 6412939
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
 

Author Comment

by:BRowley
ID: 6412996
Thanks
regards
B.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now