Solved

Double to String?

Posted on 2001-08-22
6
6,495 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

691 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