Solved

Double to String?

Posted on 2001-08-22
6
6,142 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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

707 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

12 Experts available now in Live!

Get 1:1 Help Now