Solved

Formatting Strings

Posted on 1998-03-05
2
203 Views
Last Modified: 2010-04-06
How do you use the format, Strfmt and Fmtstr functions. I am trying to take a string like this '26000' and convert it to 26,000.
0
Comment
Question by:mdlittle
[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
2 Comments
 
LVL 3

Accepted Solution

by:
d4jaj1 earned 50 total points
ID: 1360192
I'm sure there are several string manipulation outines, howver converting teh string to a number, then appling a format works best for me.  Example,

str := edit1.text;
strtofloat(str);
FormatFloat('#,##0', str);

Please add a commnet if you have any questions.  Good Luck!
0
 

Author Comment

by:mdlittle
ID: 1360193
This is a sample of how I actually got it to work. Thanks for your help.

var
   sSomeString: String;
   TheNumber: Double;
begin

   TheNumber := StrtoFloat('128577');
   SomeString := FormatFloat('#,##0', TheNumber);
end;
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi application Soap connection 5 151
Delphi selector screen 2 97
How to build JSON File in Delphi 6 3 89
Delphi and Access based Enumeration 9 86
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…

738 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