Solved

Format INT into Money

Posted on 2004-10-13
5
198 Views
Last Modified: 2012-05-05
Hi there,
I have an integer that I would like to convert to dollars and display in a label caption "2000 => $2,000" (no cents) whats the easiest way of doing so?

Thank you
0
Comment
Question by:maxb
  • 2
  • 2
5 Comments
 
LVL 7

Accepted Solution

by:
LRHGuy earned 50 total points
ID: 12303048
Try:

var
  I:integer=2000;

Label.Caption:=Format('%.0m',[I*1.0]);
0
 

Author Comment

by:maxb
ID: 12303115
Does that add the dollar sign? I dont have Delphi to test for a couple more hours...
0
 
LVL 7

Expert Comment

by:LRHGuy
ID: 12303193
It put the dollar sign when I tested it.

You can add the dollarsign in front if needed.

'$'+Format

0
 
LVL 2

Expert Comment

by:-Karamja-
ID: 12303240
For me it added £, Guess it could be on settings of pc
0
 

Author Comment

by:maxb
ID: 12407611
How do I convert the money back out into an integer?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

867 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

16 Experts available now in Live!

Get 1:1 Help Now