Solved

Formatting Strings

Posted on 1998-03-05
2
197 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
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

6 Experts available now in Live!

Get 1:1 Help Now