Solved

Format INT into Money

Posted on 2004-10-13
5
200 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying 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

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

820 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