Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 209
  • Last Modified:

Format INT into Money

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
maxb
Asked:
maxb
  • 2
  • 2
1 Solution
 
LRHGuyCommented:
Try:

var
  I:integer=2000;

Label.Caption:=Format('%.0m',[I*1.0]);
0
 
maxbAuthor Commented:
Does that add the dollar sign? I dont have Delphi to test for a couple more hours...
0
 
LRHGuyCommented:
It put the dollar sign when I tested it.

You can add the dollarsign in front if needed.

'$'+Format

0
 
-Karamja-Commented:
For me it added £, Guess it could be on settings of pc
0
 
maxbAuthor Commented:
How do I convert the money back out into an integer?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

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