[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 207
  • 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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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