Solved

Formatting Strings

Posted on 1998-03-05
2
202 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
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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

821 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