Solved

Double to String?

Posted on 2001-08-22
6
6,359 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
Technology Partners: 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

740 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