Solved

Format INT into Money

Posted on 2004-10-13
5
201 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

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