Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Formatting Strings

Posted on 1998-03-05
2
Medium Priority
?
210 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 200 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

618 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