• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 213
  • Last Modified:

Formatting Strings

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
mdlittle
Asked:
mdlittle
1 Solution
 
d4jaj1Commented:
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
 
mdlittleAuthor Commented:
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now