Solved

Format INT into Money

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

759 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

26 Experts available now in Live!

Get 1:1 Help Now